File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes illegalstateexception i am getting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "illegalstateexception i am getting" Watch "illegalstateexception i am getting" New topic

illegalstateexception i am getting

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
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

Joined: Mar 02, 2005
Posts: 580
can we have your JSP and possibly some info about that page
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
It seems like somewhere in your JSP you have already written to the response (commited the response) before doing the redirect.

So much trouble in the world -- Bob Marley
Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
Shift the redirect logic earlier in the page before you do any output.
Alternative: make the page buffer bigger <%@ page buffer="16k" %>
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

I've just added an entry in the JSP FAQ for IllegalStateException with a code example for fixing/preventing it.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: illegalstateexception i am getting
It's not a secret anymore!