The problem you are facing is - the server already committed the response,
that is it already wrote part of the response. Once this is done, you cannot
redirect the page.

There are two options for this
    - You increase the default buffer size of 8k in the JSP page (the
response will be committed after it exceeds the buffer size)
    - You can shift the logic for redirecting to the top of the page.

This problem typically happens in jsp pages with considerable amount of
code, or with servlets when you write to the servlet output stream before
redirecting.


----- Original Message -----
From: "Asad Habib" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 8:29 PM
Subject: Redirecting the browser to another page


> Does anyone know how to do this successfully? I am using the "response"
Jakarta Taglib but I keep getting the following error:
>
> javax.servlet.ServletException: Response sendRedirect tag could not return
the redirect: Response has already been committed
>
> I am using the following code:
>
> <%@ taglib uri="http://jakarta.apache.org/taglibs/response-1.0";
prefix="response" %>
>
> <response:sendRedirect>
>
<response:encodeRedirectUrl>"http://somepage.jsp";</response:encodeRedirectUr
l>
> </response:sendRedirect>
>
> I don't quite understand how the server has committed a request to the
client and if it has, how can I uncommit that request so that the client can
be redirected successfully?
>
> Any help would be greatly appeciated. Thanks.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to