What is the use of RequestDispatcher in servlet?
Answer Posted / bhudeep
RequestDispatcher is used to dispatch the request.that means
one resource take the ownership from another
resources (Servlets,jsps,htmls) available in the web
applicaions for handle the request.
we can get RequestDispatcher in two ways
1. servletContext.getRequestDispatcher("/absolute 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 ? | 21 Yes | 12 No |
Post New Answer View All Answers
Difference between java beans & servlets?
What are all the protocols supported by httpservlet?
What do you mean by servlet context?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
What is the servlet?
What's the use of servletcontext?
What are the types of servlets? Explain
What if you need to span your transaction across multiple servlet invocations?
What are sessions in servlets?
How do we translate jsp?
How to get the current httpsession object?
Why servlet is mostly used?
What is Client-Server Computing?
What is load-on-startup in servlet?
What exactly is a servlet?