Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegalstateexception i am getting

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
The following error i am getting in jsp can you tell me why it is coming.response.sendredirect(); is not working in my jsp,there only error is coming.

[ June 08, 2006: Message edited by: Bear Bibeault ]
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we have your JSP and possibly some info about that page
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like somewhere in your JSP you have already written to the response (commited the response) before doing the redirect.
 
Stefan Evans
Bartender
Posts: 1712
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shift the redirect logic earlier in the page before you do any output.
Alternative: make the page buffer bigger <%@ page buffer="16k" %>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just added an entry in the JSP FAQ for IllegalStateException with a code example for fixing/preventing it.

http://faq.javaranch.com/view?IllegalStateException
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic