What is the use of RequestDispatcher in servlet?

Answer Posted / sekharbabu

RequestDispatcher is used to move/call the another
resources (Servlets,jsps,htmls) available in the web
applicaions
we can get RequestDispatcher in two ways
1. servletContext.getRequestDispatcher("/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 ?    25 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

540


What is Servlet API used for connecting database?

619


Define context initialization parameters.

574


How the servlet is loaded?

599


Explain the difference between a web server and a web container?

516






If servlet receives multiple requests, how many objects will it create?

829


What is the use of httpservletresponsewrapper?

534


What is a servlet-to-servlet communcation?

648


what do you understand by url rewriting?

546


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

586


What is the servlet?

620


What are different methods of session management in servlets?

780


What is servlet instance?

544


What do you mean by httpservlet?

563


Explain the features are in servlet 3?

603