Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EPractice Lab quiz 2 about HttpSessionBindingListener's valueUnbound  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1514
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which interface must a class implement so that instances of the class are notified after any object is removed from a session?

a. javax.servlet.http.HttpSessionAttributeListener
b. javax.servlet.http.HttpSessionListener
c. javax.servlet.http.HttpAttributeSessionListener
d. javax.servlet.http.HttpSessionBindingListener

Choice A is correct
HttpSessionAttributeListener listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application.


I think D can be the option. When an object ,which implements HttpSessionBindingListener, is removed from the attribute list of a session, valueUnbound() is called.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!