Hi All,
I'm just working with JSPs calling servlets, who in turn call another JSP.
JSP->SERVLET->JSP
I'm also working with servlets calling one another.
SERVLET->SERVLET
I'm using JSWDK-1.0.1.  For jsp->servlet->jsp, I'm having problems in that
I am able to get my jsp page to be called, but when I call my servlet the
browser says, "The page cannot be displayed". If I hit refresh my servlet
then works.
For servlet->servlet, I'm getting the error (on JSDK2.0)
SimpleServlet.java:54:Method getRequestDispatcher(java.lang.String)not
found in interface javax.servlet.ServletContext.

getServletContext().getRequestDispatcher("YouTheManEd.jsp").forward(request,
response);


Here is my code...
    public void doGet (
        HttpServletRequest      request,
        HttpServletResponse     response
    ) throws ServletException, IOException
    {
        PrintWriter             out;
        String                  title = "Ed's Power Sample Servlet
Output";

        // set content type and other response header fields first
        response.setContentType("text/html");

        // then write the data of the response
        out = response.getWriter();
        //NEW STUFF
        {

getServletContext().getRequestDispatcher("YouTheManEd.jsp").forward(request,resp

onse);
        }
        catch(Exception ex)
        {
        out.println("<HTML><HEAD><TITLE>");
        out.println(title);
        out.println("</TITLE></HEAD><BODY>");
        out.println("<H1>" + title + "</H1>");
        out.println("<P>This is output from SimpleServlet.");
        out.println("</BODY></HTML>");
        out.close();
    }
    //END KIND OF NEW STUFF
    }
IT appears like I need to update my version of ServletContext class, but I
don't know how.  Thanks for your time.  Ed

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