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
What is Servlet API used for connecting database?
Describe in brief RequestDespatcher?
How can we achieve transport layer security for our web application?
Difference between doget and dopost?
What is the use of servletconfig interface?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
Servlet is pure java object or not?
When servlet object is created?
Can we use threads in Servlets?
What is the importance of init() method in Servlet ?
What if you need to span your transaction across multiple servlet invocations?
How servlet is created?
Differentiate between the print writer and servlet output stream?
What is a servlet engine?
What’s the difference between genericservlet and httpservlet?