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
What is the
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
If a servlet is not properly initialized, what exception may be thrown?
Which event is fired at the time of setting, getting or removing attribute from application scope?
Should I override the service() method?
What are the objects involved when a servlet receives a call from client?
Why do we have servlet listeners?
What is the use of servlet wrapper classes?
What do you mean by servlet context?
What is the functionality of actionservlet and requestprocessor?
Describe servlet?
Difference between GET and POST?
What is difference between jsp and servlet?
Explain is servlet mapping?
What do you mean by httpservlet?