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
Define servlet mapping?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
When should you prefer to use doget() over dopost()?
What is the use of java servlet api?
How do you run a servlet?
What are the life cycle methods of a servlet?
What's the servlet interface?
Can you send an authentication error from a servlet?
How to read request headers from servlets?
How can we perform any action at the time of deploying the project?
What is the difference between CGI and Servlet?
What is servlet instance?
What do you mean by httpservlet and how it is different from the genericservlet?
What are all the protocols supported by httpservlet?