Yes. You need code in your servlet something like this:

        protected void callPage(String page, HttpServletRequest request,
HttpServletResponse response)
                throws ServletException, IOException
        {
                ServletContext context = getServletContext();
                RequestDispatcher dispatcher =
context.getRequestDispatcher(page);
                dispatcher.forward(request, response);
        }

The easiest way I've found to pass values from a servlet to an output JSP is
to attach them to the servlet session. In other words, your error JSP might
contain code like this:

        <jsp:useBean id="ExceptionData" scope="session"
class="my.ExceptionData"/>
        <P>Error code: <jsp:getProperty name="ExceptionData"
property="ErrorCode"/></P>

----------
Craig S. Cottingham
[EMAIL PROTECTED]
PGP key available from:
<http://pgp.ai.mit.edu:11371/pks/lookup?op=get&search=0xA2FFBE41>
ID=0xA2FFBE41, fingerprint=6AA8 2E28 2404 8A95 B8FC 7EFC 136F 0CEF A2FF BE41

> -----Original Message-----
> From: luke olegario [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 10, 1999 4:46 AM
> To:
> Subject: Calling an JSP Error Page from a Servlet
>
>
> Hi,
>
> Is it possible to call a JSP error page from a servlet?  If
> it's so, how
> would you invoke it and how would you pass the exception
> object for the JSP
> error page to process?
>
> Regards,
> Luke
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to