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

        -----Original Message-----
        From:   Bilal Ali Nawaz [SMTP:[EMAIL PROTECTED]]
        Sent:   Tuesday, May 02, 2000 5:05 PM
        To:     [EMAIL PROTECTED]
        Subject:        forward tag!!!

        hi all,
        i'm trying to route to an error page if a user gives a wrong id or
password on a
        login page. i'm taking the id and password, sending it to a bean and
based on
        the result, want to forward it either to an error page or a normal
page. somehow
        or the other, the <jsp:forward page ="error.jsp"/> syntax isn't
working. can
        anyone please help me with this??
        thanking you in advance,
        bilal.

_________________________________________________________________________


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





_________________________________________________________________________

Disclaimer:

"This  message is confidential. It may also be privileged or otherwise protected
by  legal  rules. If you have received it by mistake please let us know by reply
and then delete it from your system."

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

Reply via email to