First, I don't know why this worked in Tomcat 3.2. Perhaps the default buffer size was larger.
What's probably happened is that you've generated a partial response whose size is greater than the response default buffer size (which is 8kb). Therefore, this partial response (which includes the response headers) was committed to the client. Now, when you do a response.sendRedirect() you are sending an HTTP 302 response to the client...BUT...you've *already* sent all the response headers when the buffer was flushed. IOW, you cannot set response headers *after* the response has been committed -- it leads to the ISE you're seeing. I think the best thing to do it to decide **very early** in the processing about whether or not you will need to redirect. Make this decision *before* generating any of the response. If it's too hard to do this, then, "Plan B": change the size of the response buffer to be something larger -- try 25kb, for example. ----- Original Message ----- From: "Christopher Doyle" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 27, 2002 2:18 PM Subject: response.sendRedirect > Hi all-- > > I have this problem using the response.sendRedirect method. I've used the > method and it works fine on Tomcat 3.2, but when I switched to Tomcat 4.0.4 > I started to receive IllegalStateException errors when my servlet tried to > process the response.sendRedirect method. Has anyone else had similar > problems? Or know of another way to call a JSP page from within a servlet > (without rewriting the entire page)? > > response.sendRedirect(http://localhost:1964/BookNook/index.jsp); > > nor > > response.sendRedirect(http://localhost:1964/BookNook/index.jsp); > > seem to work anymore... > > > Thanks > > Chris > [EMAIL PROTECTED] > > _________________________________________________________________ __________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
