This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalStateException when redirecting the response...

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using struts for my application. In my main jsp, I am checking the user name, if the username is empty hv to redirect to somewhere elese, typically a error page...
but i am getting IllegalStateException....


any help would be highly appreciated...

tia,
shakthi.
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiiii.......


i guess if u r using struts.. instead of doing so much u can do


i guess this shuold solve ur prob.. if still in doubt revert back
 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, amit....
Originally posted by Amit KumarS:



what is "error" here? target jsp name? or another action defined in struts confilg file?
If I give jsp name, I again get IllegalStateException/
If I give one action name from struts-config file, I get



I mentioned entry...which is a action defined in st-config file.
Pls help me....
 
Ken Robinson
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using a RequestDispatcher and see if you get any change in results.

ReqeustDispatcher rd = getServletContext().getRequestDispatcher("/equationweb/Regret?");
rd.forward(req, res);
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi...

error is entry in struts-config.xml

u can add following entry in struts-config.xml file.. and whenever u pass error as i did in jsp:forward then it will redirect to error.jsp page in following case




hopwe this helps.. still still in doubt revert back

take care
Amit
 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same error Ken

 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wat abt my tag..

did that work... and for that error that response is commited.. check if u have written return statement before forwarding or u have used flush()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic