Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher

 
Raghavendra Holla
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic