Hi Edward,
The buffer the contianer is talking about is not System.out (the stream
that writes to your server window), but rather out (the stream that
sends the page to the browser). You are exceeding the 8kb buffer before
doing the jsp:forward and therefore part of the response is already
committed and it can no longer forward.
You can remedy the problem by either:
A. Moving your jsp:forward closer to the top of your page
B. Increasing the buffer size using something like
<%@(protected).
Hope this helps.
---
Mark Roth, Java Software
JSP 2.0 Co-Specification Lead
Sun Microsystems, Inc.
Edward King wrote:
> I want to redirect one JSP to another JSP,like follows:
> /* one JSP */
> ....
> boolean flag;
> System.out.println("some information");
> ....
> //Then I call JavaBean and return true or false,if return false,then redirect Fail.jsp page
> flag=bean.somemethod();
> if(flag==false){
> %>
> <jsp:forward page="Fail.jsp" />
> <%
> }
> ....
>
>
> When I run it,it raise following error:
>
java.io.IOException: Error: Attempt to clear a buffer that's already been flushed
>
> I know before redirect another JSP,there shouldn't be any output,but I really need some output,like System.out.println() to display debug information.
> In this situation,how to redirect another JSP page?
>
> Any idea will be appreciated!
> Edward
>
> ===========================================================================
> To unsubscribe: mailto listserv@(protected)".
> For digest: mailto listserv@(protected)".
>
> 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
===========================================================================
To unsubscribe: mailto listserv@(protected)".
For digest: mailto listserv@(protected)".
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