aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes session, mock, p 274 - 7 c - is correct? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "session, mock, p 274 - 7 c - is correct?" Watch "session, mock, p 274 - 7 c - is correct?" New topic
Author

session, mock, p 274 - 7 c - is correct?

taty gora
Greenhorn

Joined: Nov 29, 2004
Posts: 16
hi,
why is the following answer marked as correct? ( p 274 ,7 , C)

Which statement about session attributes are true?
C. Attriutes bound into a session are available to any other servlet that belongs to the same ServletContext?
Ture Hefner
Greenhorn

Joined: Nov 14, 2004
Posts: 18
The session is scoped at the web app (servlet context) level. If you put an attribute into the HttpSession, you can get to it from any JSP or servlet in your web app. See the servlet 2.4 specification:

SRV.7.3 Session Scope
HttpSession objects must be scoped at the application (or servlet context) level. The underlying mechanism, such as the cookie used to establish the session, can be the same for different contexts, but the object referenced, including the attributes in that object, must never be shared between contexts by the container. To illustrate this requirement with an example: if a servlet uses the RequestDispatcher to call a servlet in another Web application, any sessions created for and visible to the servlet being called must be different from those visible to the calling servlet.


Ture
taty gora
Greenhorn

Joined: Nov 29, 2004
Posts: 16
�If you put an attribute into the HttpSession, you can get to it from any JSP or servlet in your web app.�
- should that JSP or servlet participate the HttpSession to have an access to that attribute?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session, mock, p 274 - 7 c - is correct?
 
Similar Threads
ServletContext n Session
sun sample mock q
HFSJ Chapter 6 - Mock exam Question 7
To all cricket lovers out there
HF ch 6 Qn7