getRequestDispatcher() was added to the Servlet 1.1 API. If you (or your
Servlet engine) is using the 2.0 Servlet API then this method is not
availible to you. Instead, you can use the old, now deprectated API,
getServletConfig().getServlet() and call the doGet or doPost methods
directly.
Chris
[EMAIL PROTECTED]
-----Original Message-----
From: Telmo S� [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 02, 1999 1:19 PM
To: [EMAIL PROTECTED]
Subject: How do i call a Jsp from a Servlet
Hello all!
I'd like to call a JSP from a servlet.
The servlet gets info from a DB and then cals a JSP to present the
information.
I have seen this code
import javax.servlet.*;
import javax.servlet.http.*;
public class servletToJsp extends HttpServlet {
public void doGet (HttpServletRequest request,
HttpServletResponse response) {
try {
// Set the attribute and Forward to hello.jsp
request.setAttribute ("servletName", "servletToJsp");
getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/
hello.jsp").forward(request, response);
} catch (Exception ex) {
ex.printStackTrace ();
}
}
}
but the getRequestDispatcher is not in my documentation for javax.servlet.*;
and javax.servlet.http.*;.
So i'm wondering if this is the right way to do it.
Thank you!
Telmo
___________________________________________________________________________
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