What is the use of RequestDispatcher in servlet?
Answer Posted / sekharbabu
RequestDispatcher is used to move/call the another
resources (Servlets,jsps,htmls) available in the web
applicaions
we can get RequestDispatcher in two ways
1. servletContext.getRequestDispatcher("/path");
2. servletRequet.getRequestDispatcher("relativepath");
now we can move to another resources with the following
methods available in RequestDispatcher
include(req,res);
forward(req,res);
Is This Answer Correct ? | 25 Yes | 17 No |
Post New Answer View All Answers
What is the life cycle of a servlet?
Why don't we write a constructor in a servlet?
What is the difference between 2 types of servlets?
Explain the difference between servlet and cgi?
Which application server is best for java?
What is Servlets and explain the advantages of Servlet life cycle?
What are the drawbacks of cgi?
What is http servlet?
Explain request dispatcher and its methods.
What is servlet container?
Given the request path below, which are context path, servlet path and path info?
What are all the advantages of servlet over cgi?
Who is responsible to create the object of servlet?
Why filter is used in servlet?
What is the difference between CGI and Servlet?