wood burning stoves 2.0*
The moose likes Servlets and the fly likes RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher" Watch "RequestDispatcher" New topic
Author

RequestDispatcher

Raghavendra Holla
Ranch Hand

Joined: Jun 02, 2000
Posts: 58
Hello All,
What is the difference between RequestDispatcher's forward method and include method? In which context each can be better utilised.
Thanks in adavnce for your help.
Regards,
Holla
Sagar Sharma
Ranch Hand

Joined: Aug 31, 2000
Posts: 92
hi,
forward : should be used only when u have not started replying to the client by ServletOutputStream or the PrintWriterStream.
include : can be used before or after the servlet has used either of the two mentioned above.
Also note that the resource called cannot set the headers, if it tries to do so then the result is not guaranteed.
HTH
sagar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher
 
Similar Threads
Changin font in a JTextArea
Finalization Method
NX: When should I throw DuplicateKeyException?
Sharpen your Pencil - Page 323 in HFEJB
garbage collection