Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispather?

 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody tell me exactly when and which scenario we use request.getRequestDispatcher() and context.getRequestDispatcher() ?
I know their programming difference. I know the exact reason. Please help me on that.

Malhar
 
Shashank Rudra
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you need to forward a request from a servlet to another resource. You will use RequestDispatcher. It will not show any change in the URL in browser and user will not know of it. Now to get this dispatcher there are two ways
or
Depends what you prefer, both ways are ok. It may depend on the availability of the handle to each of them. Though they are almost equally available.

 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you mean to say, I can use any method either request or context, it doen't matter.
right....
 
Shashank Rudra
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes exactly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic