Servlet Chaining? How do you do the Filtering in Servlets?

Answer Posted / k d rana

when request come from browser ,container send request and response object as a parameter to servlet , now when 2 or more servlet use same request object, means we forward existing request and response object to next servlet using
******
requestDispatcher rs=req.getrequestDispatcher("url of next servlet");

rs.forward(req,resp);

*******
method ,and so on ,thus we make chain of servlet to resolve same request using same request object
this is know as servlet chaning..

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a servlet context?

802


Why is Servlet so popular?

764


When jsessionid is created?

753


What is the importance of init() method in Servlet ?

791


Whats the advantages using servlets over using CGI?

773


Define declaration.

796


What is api in servlet?

729


What is Request Dispatcher?

1044


How the servlet is loaded?

770


How many objects of a servlet is created?

984


Why the container loads server at the application startup and how?

768


Given the request path below, which are context path, servlet path and path info?

745


How we can call a jsp from the servlet?

709


What is life cycle of Servlet?

782


how many jsp scripting elements are there and what are those?

768