aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HSJS Chapter-6 Question-15 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HSJS Chapter-6 Question-15 " Watch "HSJS Chapter-6 Question-15 " New topic
Author

HSJS Chapter-6 Question-15

Peter Piddle
Greenhorn

Joined: Jun 13, 2012
Posts: 26

Hi All,
I am solving mock from K&B from Chapter 6. The question asks

Which method(s) can be used to ask the container to notify your application whenever a session is about to timeout?
Options correct are A and C

  • A.HttpSessionListener.sessionDestroyed
  • C. HttpSessionBindingListener.valueUnBound


  • My question is the valueUnBound() method is related when an attribute is removed from the session, session might be existing that time.
    Then why option C is made correct?

    Thanks,

    Peter Piddle - Skype(peter.piddle)
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Bartender

    Joined: Apr 07, 2010
    Posts: 1696
        
      25

    Hi Peter,
    Then why option C is made correct?

    According to the API:
    Causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object. This may be as a result of a servlet programmer explicitly unbinding an attribute from a session, due to a session being invalidated, or due to a session timing out.


    Regards,
    Frits
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: HSJS Chapter-6 Question-15