• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HSJS Chapter-6 Question-15

 
Peter Piddle
Greenhorn
Posts: 26
IntelliJ IDE jQuery Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2445
    96
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic