Usually before redirecting response or before forwarding request it is best not open the output stream. If the output stream is committed then you should flush or close the output stream before redirecting. Some times the errors associated with redirecting and forwarding is due to the web container implementation. In such case you should contact the vendor.
Lee -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of Asad Habib Sent: Thursday, June 19, 2003 8:33 PM To: [EMAIL PROTECTED] 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:encodeRedire ctUrl> </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. -Asad ________________________________________________________________________ ___ 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