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

Question - RequestDispatcher from ServletContext

 
dharshini madhana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Why is it MUST to use the forward slash with the getRequestDispatcher() method of the ServletContext.

whereas it is not mandatory for the getRequestDispatcher() method of the ServletRequest



Regards
Priyadharshini
 
bengt hammarlund
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's because the ServletContext only have information about the context, and do not have any ideia of the request's path. But this info (the path of the request), it's necessary for supporting the relative not-back-slash String path, that the dispatcher ServletRequest gives you support.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic