This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Illegal State Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Illegal State Exception" Watch "Illegal State Exception" New topic
Author

Illegal State Exception

Vaibhav Deshpande
Ranch Hand

Joined: Apr 26, 2002
Posts: 33
Hi,
In my JSP page i have many response.sendRedirect. Is this teh reason for above exception that is more response.sendRedirect then one on same jsp
can some one help me out.
vebs
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

More than likely. This is a big argument for only placing sendRedirects and forwards in Servlets and never in JSPs.
If the buffer for the output has filled, the response will be sent to the client, and the response is 'comitted'. That is, it is now too late to send them something else or somewhere else. You need to make these decisions before you start outputting data to the client, which is why the MVC architecture and Servlets is a much better way to manage this.
Some people solve this by making the buffer larger, but this is inefficiant and only hides the problem. It doesn't solve it.
Dave
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Illegal State Exception
 
It's not a secret anymore!