What is the use of RequestDispatcher in servlet?

Answers were Sorted based on User's Feedback



What is the use of RequestDispatcher in servlet?..

Answer / srikanth

While developing complex web applications you need distribute request processing and response to multiple servlets in this case you need dispatch request from one component to another

Is This Answer Correct ?    1 Yes 0 No

What is the use of RequestDispatcher in servlet?..

Answer / mahesh

When we want to use some fields of one servlet page in
another servlet page this RequestDispatcher is very useful
through the methods

1.forward()
2.include()

Is This Answer Correct ?    3 Yes 3 No

What is the use of RequestDispatcher in servlet?..

Answer / ram

to connect another webapplication in a web application

Is This Answer Correct ?    2 Yes 2 No

What is the use of RequestDispatcher in servlet?..

Answer / gani kumar

In creating the web componets we find a requirement to reuse the components in different combinations avoiding the code duplication and have a proper reponsibility divison.
To meet this requirement in servlet envirnoment that is support a servlet acess another web resource like another servlet in the application,java servlet intrduces request dispatcher

Is This Answer Correct ?    0 Yes 0 No

What is the use of RequestDispatcher in servlet?..

Answer / malyadri b

RequestDispatcher
rd=ServletContext.getRequestDispatcher("url of resource");
rd.forward(req,res);----used to forward to another resource.
rd.include(req,res);----used to include other resource.

Is This Answer Correct ?    0 Yes 0 No

What is the use of RequestDispatcher in servlet?..

Answer / suresh g

RequestDispatcher:

RequestDispatcher class is mainly used to 'pass on'
the current request to another program (servlet) and
therefore allows 'chaining' of the programs. A
RequestDispatcher primarily contains two methods
include() and forward(). include() method includes
the response of another program while forward()
method forwards the request of the current program
to another one.

Is This Answer Correct ?    0 Yes 1 No

What is the use of RequestDispatcher in servlet?..

Answer / katamraju

By using Request dispatcher we can include or forward a
request to a another resource by using only one request
and response.

Is This Answer Correct ?    12 Yes 17 No

What is the use of RequestDispatcher in servlet?..

Answer / ravikiran

request dispatcher will forward or include the response to
the output stream

Is This Answer Correct ?    8 Yes 23 No

Post New Answer

More Servlets Interview Questions

What is a java servlet?

0 Answers  


What are session variable in servlets?

0 Answers  


What is the difference between 2 types of servlets?

0 Answers  


What is a server side include (ssi)

0 Answers  


what is meant by servlet to servlet communication?

1 Answers   KPIT,


How do you find out what client machine is making a request to your servlet

0 Answers  


What are the kinds of http requests?

0 Answers  


How a servlet is unloaded?

0 Answers  


Differentiate between the print writer and servlet output stream?

0 Answers  


What method is used to create database connection in servlets?

2 Answers  


What compiler do not do if we create our own constructor?

5 Answers   HCL,


init() method of servlet loaded by?

3 Answers  


Categories