This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Illegal State Exception

 
Vaibhav Deshpande
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic