Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ chapter 5 question 15

 
gurneeraj singh
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this line mean in question 15?

Depending on the class whose method creates requestdispatcher, the path to te resource to be forwarded to may change.
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gurneeraj..

May be you came accross that Request dispatcher can be created by either ServletRequest or ServletContext.
This what makes difference to the path because, you can use the '/' notation in servletrequest but not with servletcontext..


Hope you got it..
 
Atul Samnerkar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use the '/' notation in servletrequest


this is exactly opposite. When you get the RD object from context then you have to use the context path. (which starts with '/')

how ever when you get the RD object from the request, then you can use the relative path. Here it is container's responsibility to convert this relative path to real path.

Cheers,
Atul Samnerkar
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh ysss atul.. your right.. actually thats what is in my mind also.. but the way i conveyed is wrong..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic