Answer Posted / sudhakar
import javax.servlet.*;
import javax.servlet.http.*;
public class TestDispatcher extends HttpServlet throws
IOException, ServletException {
public void doGet(HttpServletRequest request,
HttpServletResponse response) {
RequestDispatcher dispatcher =
request.getRequestDispatcher("/template.jsp");
dispatcher.forward(request, response);
}
}
Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
What is the difference between context parameter and context attribute?
Why doesn’t a servlet include main()?
Can we use the constructor, instead of init(), to initialize servlet?
What is a cookie What is the difference between session and cookie
Differentiate between the web server and application server?
What are the functions of the servlet container?
Can filter be used as request or response?
What is the procedure of invoking different servlet in a different application?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
What do you mean by httpservlet?
When Servlet is unloaded?
What is load-on-startup in servlet?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
What do you mean by request dispatcher in servlet?
Which event is fired at the time of session creation and destroy?