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, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html