File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes servlet problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "servlet problem" Watch "servlet problem" New topic
Author

servlet problem

dx wu
Ranch Hand

Joined: Apr 28, 2002
Posts: 60
Servlet A received a request that it forwards to Servlet B within anthor web application in the same web container . Servlet A needs to share data with Servlet B and that data must not be visible to other servlet in the A's web application.

in whici object can the data that A shares with B be stored?
A.HttpSession
B.ServletConfig
C.ServletConext
D.HttpServletRequest
E.HttpServletResponse

and i think the answer is ServletConfig, Cloud someone tell me is it correct?
thanks


good good study , day day up!
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

I think it is HttpServletRequest. As you passing a request to the Sevlet to different web application, you can not share information through HttpSession, ServletConfig or ServletContext. The Data in HttpServletRequest is available to that request only and if you are not passing this request parameter to any other Servlet/JSP in A's web application, this information will not available to them.

Thanks
[ May 09, 2005: Message edited by: Narendra Dhande ]

Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
dx wu
Ranch Hand

Joined: Apr 28, 2002
Posts: 60
thank you!
Anand Wadhwani
Ranch Hand

Joined: Mar 21, 2005
Posts: 151
Hi Narendra,


I think it is HttpServletRequest. As you passing a request to the Sevlet to different web application, you can not share information through HttpSession


Session CAN be used across multiple applications within same web container as long as request is same. However, this is an incorrect answer in the above question because other servlets should not be able to see data.

Please confirm my understanding. Thanks!


SCWCD 1.4<br />---------------------<br />Ability is what you're capable of. <br />Motivation determines what you do. <br />Attitude determines how well you do it.<br />---------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet problem