• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HFSJ mock Exam Doubt

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Which statements about session attributes are true? (Choose all that apply.)
A. The return type of HttpSession.getAttribute(String) is Object.
B. The return type of HttpSession.getAttribute(String) is String.
C. 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.
D. Calling setAttribute(“keyA”, “valueB”) on an HttpSession which already holds a value for the key keyA will cause an exception
to be thrown.
E. Calling setAttribute(“keyA”, “valueB”) on an HttpSession which already holds a value for the key keyA will cause the previous value for this attribute to be replaced with the String valueB


answer was given as A,CE .
can anyone explian me the meaning of ans C??
 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.



session is meant for one per JVM, and servlet context also belongs to one per JVM. all the request which are asscociate by a particualr seesion (by belong to a particular client) can access the undelying sessin object and related attributes also.

session can be persist as long as a servlet contaxt.
 
sravanthi pulukuri
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks poonam!!!
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AnyTime Budy keep posting
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic