You can buffer the output sent from the JSP page to the client browser using
the directive
<%@page buffer="sizeinkb" % <mailto:%@page buffer=> >
The default size is 8kb,,,
When you buffering it then you need to use
<%@page autoflush="true"% <mailto:%@page autoflush=> > so that whenever the
buffer gets full then its automatically flushed..
What is the error you are getting??
See if you are using "/error.jsp" then the location of this .jsp will be
relative to JSP
Application's document root directory..
So check out the path....of error.jsp
-----Original Message-----
From: Bilal Ali Nawaz [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, May 02, 2000 5:50 PM
To: [EMAIL PROTECTED]
Subject: Re: forward tag!!!
hi, following is the code that isn't working. the purpose is not to
simply use
an error page. the purpose is to implement a login workflow using
only jsps. i'm
not aware of the page buffer concept so it'll be great if you can
elaborate on
that.
<%
String id= request.getParameter("id");
String password = request.getParameter("password");
if(id != null)
{
boolean result = mybean.validations(); //validates whether
the user
entered the correct password and userid.
if ( result ==false ) //if not
{ %>
<jsp:forward page = "/error.jsp" />//forward to
a page where
the appropriate error can be displayed.
<% } %>
please also keep in mind that the user will have to come back to the
login page.
i hope the forward tag doesn't affect any beans that i have
instantiated in my
login page.
thanks,
bilal.
"Aggarwal, Pawan" <[EMAIL PROTECTED]> on 05/02/2000
05:06:27 PM
Please respond to A mailing list about Java Server Pages
specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Bilal Ali Nawaz/PK/ABNAMRO/NL)
Subject: Re: forward tag!!!
Hi,
If the output from the JSP page is buffered then , the buffer is
cleared
before the request is forwarded
However, if you are using the directive buffer=none and anything is
written
to the buffer, then if you use the forward syntax
Then you will get an IllegalStateException.
If thats the error you are getting better check out...
If your sole purpose is to goto an error page you can
Declare a directive as %@page errorpage="Error.jsp"% <mailto:%@page
errorpage=> over the page from where you want to forward
And then create an Error.jsp page
Over that you can state <%page isErrorPage="true"%>
And out here you can display the message saying "invalid login" blah
blah....
Hope this solves your problem
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets