[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    RE: How to handle forward instructions within an action class?
From:       "Michael Oliver" <ollie () alariussystems ! com>
Date:       2005-09-30 17:53:53
Message-ID: 000601c5c5e7$ec184d20$6501a8c0 () OllieXP
[Download RAW message or body]

I can't say for sure because I can't see the whole Action class execute
method, but....it appears you are thinking the Action class is the servlet
and it is not, you cannot forward from the Action class as your Action
returns a forward object.  Try using the Struts mechanisms instead of brute
force, its easier and more flexible.


Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)643-7425
Fax:(702)974-0341
*Note new email changed from oliverm@matrix-media.com

-----Original Message-----
From: Jeff Thorne [mailto:jeff_thorne@yahoo.com] 
Sent: Friday, September 30, 2005 9:32 AM
To: Struts Users Mailing List
Subject: How to handle forward instructions within an action class?


I have the following code in an action class:

else if(action.equals("sendMessage"))
 {
     String member = request.getParameter("member");
     RequestDispatcher view =
request.getRequestDispatcher("sendMemberInvite.jsp?member=" + member );
     view.forward(request, response);
}


This code works successfully but is causing the following error in the
tomcat log files

Servlet.service() for servlet action threw exception
java.lang.IllegalStateException: Cannot forward after response has been
committed

Can someone shed some light on why I am getting this error and how I should
handle forward instructions within an action class. Any help or insight
would be appreciated.

Thanks,
Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic