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

Is servlet a controller?

643


What is servlet name in web xml?

641


How the servlet is loaded?

679


What is the servletconfig object?

616


How can the session in servlet can be destroyed?

787






What do you mean by httpservlet?

649


What is dispatcher servlet?

653


What is the need of servlet filters?

627


How can the session in servlet be destroyed?

726


What are the different methods of session management in servlets?

614


Can you refresh servlet in client and server-side automatically?

718


Describe servlet?

656


What are the differences between the servletconfig interface and the servletcontext interface?

674


Can you call a jsp from the servlet?

636


How to get the IP address of client in servlet?

717