*
The moose likes Servlets and the fly likes IllegalStateException when redirecting the response... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "IllegalStateException when redirecting the response..." Watch "IllegalStateException when redirecting the response..." New topic
Author

IllegalStateException when redirecting the response...

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 102
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.


Regards,
Shakthi
Amit KumarS
Ranch Hand

Joined: Oct 10, 2003
Posts: 100
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


****************************<br />In 24 hrs Earth rotates once on its Axis.
Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 102
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

Joined: Dec 23, 2003
Posts: 101
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

Joined: Oct 10, 2003
Posts: 100
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

Joined: Jun 17, 2000
Posts: 102
Same error Ken

Amit KumarS
Ranch Hand

Joined: Oct 10, 2003
Posts: 100
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()
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalStateException when redirecting the response...
 
Similar Threads
Session Object
session expiry
is this good for logout page
Regarding sessions in servlets
HOw to get session variables between portlets ?