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 are the exceptions thrown by servlets? Why?
How the servlet is loaded?
What exception should be thrown when servlet is not properly initialized?
Difference between GET and POST?
What is war file?
How do we call one servlet from another servlet?
What are the different types of servlets?
How can you create a session in servlet?
What is a servlet context?
Can you explain in detail 'javax.servlet' package?
When servlet is loaded?
Explain web application directory arrangement?
What is servlet used for?
Define declaration.
Why servlet is faster than jsp?