You need JSDK2.1. If you check source code for JSDK2.0, you will find out
JSDK2.0 does not have the RequestDispatcher class.
On Wed, 27 Oct 1999, Vaidyanathan_g wrote:
> Hi,
>
> When I try use RequestDispatcher to forward to another page I get a
> compilation error (Class RequestDispatcher not found). I have got JSDK2.0,
> Orion Web Server and JDK 1.2.2.
>
> The file compiled is
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.util.*;
>
> public class SessionTracking extends HttpServlet
> {
>
> public void doPost ( HttpServletRequest request,
> HttpServletResponse response )
> throws ServletException, IOException
> {
> PrintWriter out;
> String title = "MyServlet Output";
>
> String username=" ";
>
> HttpSession session = request.getSession(true);
> SessionValue sesval
> =(SessionValue)session.getValue(session.getId());
> username = sesval.getSessionUser();
>
> response.setContentType("text/html");
>
> RequestDispatcher dispatcher =
> getServletContext().getRequestDispatcher("/servlet/SelectServletBean");
> dispatcher.forward(request, response);
>
> out = response.getWriter();
> out.println("<HTML><HEAD><TITLE>");
> out.println(title);
> out.println("</TITLE></HEAD><BODY>");
> out.println("<H1>" + title + "</H1>");
> out.println("<H2> You are " + username + ". I can remember
> you. </H2>");
>
>
> out.println("<P>This is output from." + getClass().getName()
> );
> out.println("</BODY></HTML>");
> out.close();
> }
>
> }
>
>
> The errors reported are:
>
> 1. Class RequestDispatcher not found
> 2. Method getRequestDispatcher(java.lang.string) not found in interface
> javax.servlet.ServletContext.
>
> Do i need to import any additional libraries?
>
> Thanks in advance.
>
> Regards,
>
> Vaidya
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html