Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalStateException

 
Masha Klimenko
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum.

Mark
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Run a search on this forum or Google on filters. You can write a filter that checks if the user is logged in.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic