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
you can use the following code to do forwarding of servlet.
ServletContext sc = getServletConfig.getServletContext();
RequestDispatcher rd = sc.getNamedDispatcher("myservlet");
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?