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

doubt in request dispatcher concept in servlets

 
Saicharan velury
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working towards getting certified in Web component development(SCWCD).when i was referring the book "headfirst for jsp and servlets" by Kathy sierra i came across a concept of request dispatcher.after studying the concept i read a statement whose meaning i was unable to understand.The statement is

Depending on the class whose method creates a requestdispatcher the path to the resource to be forwarded to will change.

what's the relationship between the method of the class that created the requestdispacher and the path to the resource the requst will be forwared.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the RequestDispatcher via ServletContext#getRequestDispatcher or ServletRequest#getRequestDispatcher. The difference is that the ServletRequest method can take a relative path. I think that is what they mean by "Depending on the class whose method creates a requestdispatcher the path to the resource to be forwarded to will change."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic