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

What does it mean?

 
Selvaraj Subramanian
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read this line form Whizlabs,

Addtional request scoped attributes are added when the requestDispatcher is not obtained using getNamedDispatcher().
Both can have request scoped attributes know...

Can anyone explain me about it?
[ June 29, 2006: Message edited by: Selvaraj Subramanian ]
 
Gaurav Gambhir
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the servlet is obtained using include method of RequestDispatcher,the invoked servlet has access to the path by which it was invoked so following attributes must be set
javax.servlet.include.request_uri
javax.servlet.include.context_path
javax.servlet.include.servlet_path
javax.servlet.include.path_info
javax.servlet.include.query_string

same is the case while using forward method of RequestDispatcher
The following request attributes must be set:
javax.servlet.forward.request_uri
javax.servlet.forward.context_path
javax.servlet.forward.servlet_path
javax.servlet.forward.path_info
javax.servlet.forward.query_string


If the forwarded/included servlet was obtained by using the getNamedDispatcher method, these attributes must not be set.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the Servlet spec at :

SRV.8.3.1 Included Request Parameters
SRV.8.4.2 Forwarded Request Parameters

Here is an extract:

Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the include method of RequestDispatcher has access to the path by which it was invoked. The following request attributes must be set:
javax.servlet.include.request_uri
javax.servlet.include.context_path
javax.servlet.include.servlet_path
javax.servlet.include.path_info
javax.servlet.include.query_string
 
Selvaraj Subramanian
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Gaurav Gambhir & Satou kurinosuke, Now I got it.
 
salil verma
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I saw in j2ee docs but could not find the attributes with name

javax.servlet.forward.request_uri
javax.servlet.forward.context_path
javax.servlet.forward.servlet_path
javax.servlet.forward.path_info
javax.servlet.forward.query_string

can you let me know, where it might be available in j2ee docs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic