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 The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HSJS Chapter-6 Question-15 " Watch "HSJS Chapter-6 Question-15 " New topic

HSJS Chapter-6 Question-15

Peter Piddle

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?


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

    Joined: Apr 07, 2010
    Posts: 1934

    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.

    jQuery in Action, 2nd edition
    subject: HSJS Chapter-6 Question-15