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

Servlets/jsp

 
Shini Akshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the mock exam Chapter 6 of HFJS , I found the following statement is true, but I marked it as false.
Statement is : " Attributes bound into a session are available to any other servlet that belongs to the same Servlet Context"

What I feel is : Attributes bound to a session must be available only to that session . I they are available to the ServeletContext means to many sessions isn't it? Please somebody clarify this to me. Please send a code sample to get this clarified
 
Ken King
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is Question #7, you left out half of the statement...the whole statement reads:

"Attributes bound into a session are available to any other servlet that belongs to the same ServletContext and handles a request identified as being part of the same session.

This statement is word for word out of the Servlet 2.4 specification document (page 59).

To rephrase it, any attributes that are bound into a session are available to all servlets that (a) are a part of the same ServletContext AND (b) handle requests that are a part of the same session.

Hope this clarifies.
 
Shini Akshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much this is clarified
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic