• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

IllegalStateException when redirecting the response...

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same error Ken

 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic