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

Reply via email to