• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

RequestDispatcher

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone confirm this

1. if i use getRequestDispatcher("string") to get the dispatcher and then

a. use forward on the dispatcher -
the following attributes :

Value of javax.servlet.include.request_uri : will be same the first request in the filterchain or same as those of servlet from which request was forwarded


javax.servlet.include.context_path - will be same the first request in the filterchain or same as those of servlet from which request was forwarded


javax.servlet.include.servlet_path - will be same the first request in the filterchain or same as those of servlet from which request was forwarded


javax.servlet.include.path_info - will be same the first request in the filterchain or same as those of servlet from which request was forwarded

javax.servlet.include.query_string - querystring used while creating requestdispatcher


b use include on the dispatcher -
the following attributes :


Value of javax.servlet.include.request_uri : will be that of requestdispather and not be the value of the servlet which included this page

javax.servlet.include.context_path : will be that of requestdispather and not be the value of the servlet which included this page

javax.servlet.include.servlet_path : will be that of requestdispather and not be the value of the servlet which included this page

javax.servlet.include.path_info : will be that of requestdispather and not be the value of the servlet which included this page

javax.servlet.include.query_string - querystring used while creating requestdispatcher




2. if getNamedDispatcher is used

a. include / forward

javax.servlet.include.request_uri - not set
javax.servlet.include.context_path - not set
javax.servlet.include.servlet_path - not set
javax.servlet.include.path_info - not set
javax.servlet.include.query_string - not set
[ February 21, 2007: Message edited by: Vinod Iyer ]
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
??
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not understanding your question?
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vinod,

This is correct.
1. w.r.t RequestDispatcher & forward:

From SRV.8.4.2:
The values of these attributes must be equal to the return values of the
HttpServletRequest methods getRequestURI, getContextPath, getServletPath,
getPathInfo, getQueryString respectively, invoked on the request object passed to the first servlet object in the call chain that received the request from the client.
These attributes are accessible from the forwarded servlet via the
getAttribute method on the request object. Note that these attributes must always reflect the information in the original request even under the situation that multiple forwards and subsequent includes are called.



2. w.r.t RequestDispatcher & include:

From SRV.8.3.1:
These attributes are accessible from the included servlet via the getAttribute method on the request object and their values must be equal to the request URI, context path, servlet path, path info, and query string of the included servlet, respectively.



3. w.r.t RequestDispatcher obtained using getNamedDispatcher method, these attributes are not set.

Thanks and regards,
saurabh
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Saurabh
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
good..!
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic