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


Please Help Members By Posting Answers For Below Questions

What is called Session Tracking?

604


What is api in servlet?

529


Can filter be used as request or response?

546


Define context initialization parameters.

579


How many objects of a servlet is created?

796






What are Servlets?

601


Explain servlet.

573


What is a servlet context object?

628


Describe servlet?

585


Difference between doget and dopost?

682


What is the life cycle of a servlet?

791


What is a generic servlet?

524


How are filters?

587


Explain load on start-up and its importance?

601


What is http servlet?

586