Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between <jsp:forward> and RequestDispatcher

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know the difference between <jsp:forward> standard action and RequestDispatcher as both are used to forward the request.
 
Jagdish Hatagale
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With RequestDispatcher you can pass the request object for next page,
means you pass the control and data with the help of RequestDispatcher, but with jsp:forward you cant sent the request object you just transfer the control to next page.
 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are same. When <jsp:forward> is translated to servlet then requestdispatcher is used to forward the request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic