hi,

Thats true, I get such errors too.
For this you could, the following approach:

Instead of
...
...
...
%>
          <jsp:forward page="Fail.jsp" />
<%
...
...
...

use this
...
...
...
response.sendRedirect("Fail.jsp");
<#####>
...
...
...

And in the place where I have added "<#####>", add code so that you can jump
to the end of the current jsp page (like a break statement or something or
perhaps a return should also do the trick) this will avoid further
processing & will jump to the Fail.jsp immediatly.

Please let me know if somthing fails or something isnt clear.

Regards,
Arun Karthik R

-----Original Message-----
From: Edward King [mailto:[EMAIL PROTECTED]
Sent: Monday, September 06, 2004 12:43 PM
To: [EMAIL PROTECTED]
Subject: How to redirect JSP page?


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 [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

===========================================================================
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