What is the use of RequestDispatcher in servlet?
Answer Posted / bhudeep
RequestDispatcher is used to dispatch the request.that means
one resource take the ownership from another
resources (Servlets,jsps,htmls) available in the web
applicaions for handle the request.
we can get RequestDispatcher in two ways
1. servletContext.getRequestDispatcher("/absolute 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 ? | 21 Yes | 12 No |
Post New Answer View All Answers
What is difference between get and post method?
What are the kinds of http requests?
Can we fetch the attributes related to a servlet on a different servlet?
What is the structure of the http response
Where do you define dispatcherservlet?
How is a servlet implemented in code?
What are the drawbacks of cgi?
What is called servlet mapping?
How httpservlet is different from the genericservlet?
What are the steps involved in placing a servlet within a package?
Difference between java beans & servlets?
What are the different session tracking techniques?
What are the features added in Servlet 2.5?
Can you create a deadlock condition on a servlet?
Why doesn’t a servlet include main()?