What is the use of RequestDispatcher in servlet?

Answer Posted / naresh

consider there are two servlet,such as "aservlet"
and "bservlet"
suppose a client requests "aservlet" ,which
inturn "aservlet" depends on "bservlet"
we must redirect the request from "aservlet" to "bservlet

this is done by two steps :-
1.RequestDispatcher disp= getServletContext
().getRequestDispatcher("/url of bservlet");
2.
2.1.- rd.forward(req,res);
2.2.-rd.include(req,res);

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are advantages of servlets over cgi?

717


Can you create a deadlock condition on a servlet?

668


What is servlet? Explain

663


What is URL Encoding?

703


Why servlet is faster than jsp?

645






Name the packages that work with servlet?

623


Why jsp is better than servlet?

615


Explain the working of service() method of a servlet.

590


Who is responsible to create the object of servlet?

810


Which httpsession object is used to view and manipulate information about a session?

828


Can you send an authentication error from a servlet?

601


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

674


Explain the custom jsp tags and the beans.

691


How do you load an image in a Servlet?

758


What do you mean by scope object and what are its types?

658