For your second problem, that's because that method actually doesn't exist in JSDK
2.0's ServletContext class. If you're really attached to JSDK 2.0, you'll have to use
the getServlet method instead. (See the URL below.) Otherwise, it sounds like you need
to upgrade your entire JSDK. Who knows, maybe that will fix your other problem, too.
:-)
http://java.sun.com/docs/books/tutorial/servlets/communication/other-servlets.html
Liz
[EMAIL PROTECTED]
http://www.gymell.com
[EMAIL PROTECTED] wrote:
> 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("");
out.println(title);
out.println("");
out.println("" + title + "");
out.println("<P>This is output from SimpleServlet.");
out.println("");
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
___________________________________________________________________________
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