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 element?

772


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

823


If a servlet is not properly initialized, what exception may be thrown?

851


Which event is fired at the time of setting, getting or removing attribute from application scope?

860


Should I override the service() method?

857


What are the objects involved when a servlet receives a call from client?

748


Why do we have servlet listeners?

792


What is the use of servlet wrapper classes?

877


What do you mean by servlet context?

795


What is the functionality of actionservlet and requestprocessor?

789


Describe servlet?

765


Difference between GET and POST?

890


What is difference between jsp and servlet?

876


Explain is servlet mapping?

754


What do you mean by httpservlet?

750