What is the use of RequestDispatcher in servlet?

Answer Posted / tirupathi rao

RequestDispatcher is used to connect to another webresource
with in the same context.

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 ?    132 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the supporting protocol by HttpServlet ?

860


What is SingleThreadModel interface?

865


What is the advantage of Servlets when compared with other server side technologies?

2074


What are the life cycle methods of the servlet?

809


How do I support both get and post from the same servlet?

937


How many servlet objects are created?

773


What do you mean by servlet context?

797


What is the purpose of dispatcherservlet properties?

709


What must be implemented by all servlets?

792


Why servlet is used as controller ? Not JSP? I want complete explation?

878


Why HttpServlet class is declared abstract?

849


What is called Scriptlet?

817


Which http method is said to be non-idempotent and idempotent?

810


What are some disadvantages of storing session state in cookies?

786


How do you invoke a servelt?

826