| Author |
RequestDispatcher
|
Mathew Lee
Ranch Hand
Joined: Jun 08, 2009
Posts: 238
|
|
Hi,
I would like to know more about RequestDispatcher.When it is ,where, benefits of using it. How to invoke it. Why it needs to be used along with forward() method. Any ideas, suggestions, sample code, resources, links highly appreciated. Thanks in advance
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56223
|
|
This is more appropriate to the servlets forum, so it's been moved.
The request dispatcher is the means by which resources are included into a request, or in which request are forwarded to other resources.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Javin Paul
Ranch Hand
Joined: Oct 15, 2010
Posts: 276
|
|
RequestDispatcher is an essential utility class which has two important methods include() and forward() , include () is used in case you would like to include response from some other servlet while forward() is used when you want to forward request to some other Servlet for further processing.
RequestDispatcher is retreived by calling either ServletRequest.getRequestDispatcher() method or the ServletContext.getRequestDispatcher() method.
its important to note the difference between two former looks for resource from current path while later looks for resource form absoluter path "/"
|
http://javarevisited.blogspot.com - java classpath - Java67 - java hashmap - java logging tips java interview questions Java Enum Tutorial
|
 |
Mathew Lee
Ranch Hand
Joined: Jun 08, 2009
Posts: 238
|
|
>>>former looks for resource from current path while later looks for resource form absoluter path "/"
I have not understood above point. what you mean by current path and absoluter path. Can you please elaborate.
|
 |
 |
|
|
subject: RequestDispatcher
|
|
|