This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Cannot forward after response has been committed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot forward after response has been committed" Watch "Cannot forward after response has been committed" New topic
Author

Cannot forward after response has been committed

Ansar Shah
Greenhorn

Joined: May 02, 2007
Posts: 29
Hello All,

In an Action class's execute(..) method, when I use the PrintWriter's println() method, i can not forward the page by using
actionMapping.findForward("success");

Instead it gives following exception:


I know this is the valid case of this exception to occur. But not sure about the solution of this problem.
Please Help!
Markandey Sahu
Greenhorn

Joined: Jun 29, 2006
Posts: 13
write return null; instead of mapping.findForward();
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cannot forward after response has been committed
 
Similar Threads
page redirection problem
Problems with jsp:include
jsp error
IllegalStateException in forward
java.lang.IllegalStateException: Response already committed