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 the procedure for initializing a servlet?
What is Client-Server Computing?
Explain url encoding in servlet?
When a servlet accepts a call from a client, it receives two objects. What are they?
What is called a session?
What is the difference between genericservlet and httpservlet
Why servlet is faster than jsp?
Why session tracking is needed?
What is meant by Servlet? What are the parameters of service method?
How to handle exceptions thrown by application with another servlet?
How can you start a jta transaction from a servlet deployed on jboss?
Write a command to get actual path of a servlet to the server?
What is cookies in servlet with example?
What is Request Dispatcher?
What's the advantages using servlets than using cgi?