Discussions

EJB programming & troubleshooting: how to forward the servlet?

  1. how to forward the servlet? (3 messages)

    help how to us getRequestDispatcher method and i don't know how to forward the servlet? i am getting error while using getRequestDispatcher in servlet? write simple code for to forward the servlet

    Threaded Messages (3)

  2. how to forward the servlet?[ Go to top ]

    Hi
     you can use the following code to do forwarding of servlet.

     ServletContext sc = getServletConfig.getServletContext();
     RequestDispatcher rd = sc.getNamedDispatcher("myservlet");
     rd.forward(request,response);

    pankaj
  3. how to forward the servlet?[ Go to top ]

    I am new to this, so forgive me if I'm off base here, but I read that the Servlet life cycle is not guaranteed by the J2EE spec. It is vendor specific. With this in mind, what if the servlet you are trying to contact has not been instantiated yet? Wouldn't getNamedDispatcher return null causing a runtime exception?
  4. how to forward the servlet?[ Go to top ]

    anyone?