aspose file tools*
The moose likes Struts and the fly likes IllegalStateException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "IllegalStateException" Watch "IllegalStateException" New topic
Author

IllegalStateException

Masha Klimenko
Ranch Hand

Joined: Feb 04, 2004
Posts: 31
I am very puzzled by this:
After the struts action completes and forward is returned a few more calls are made by struts to complete the response, however an IllegalStateException is thrown in org.apache.catalina.core.ApplicationDispatcher.doForward(...) method with the usual message: Cannot forward after response has been commited. Then control returns back to my action which at that point completes successfully, and the result from jsp page is returned.
Any ideas would be appritiated. Thanks.


SCJP
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Moving to the Struts forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

U should not play with response once u have called new ActionForward () ,becoz internally it commits the response and there after u cant include,redirect/dispatch again .

so let me know if u have done something like that
Masha Klimenko
Ranch Hand

Joined: Feb 04, 2004
Posts: 31
As a matter of fact yes. The application was trying to redirect the user to the logon page the first time around, after the forward was already there to take the user to the first page in the application. For now I just put in a cheap fix - exiting out of the action in the beginning if it is the first attempt in the current session to load the page, but please feel free to suggest better approaches.
Thanks
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Run a search on this forum or Google on filters. You can write a filter that checks if the user is logged in.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalStateException