• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionActivationListener

 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do I need to config the class that implement HttpSessionActivationListener interface in web.xml?
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, any class you create that is a listener, must have an entry in the DD with the < listener> tag
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to ask same question for HttpSessionBindingListener
Do I need to config the class that implement HttpSessionBindingListener interface in web.xml?
( as it might be the possibility -> they can be found by itself through reflection , and then registered and notified )
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , i was thinking on the right track
i just checked this with by writing code
There is NO need to configure the class that implement HttpSessionBindingListener interface in web.xml
as it is being automatically notified

Now , anyone for the original qusetion by Win
Do we need to config the class that implement HttpSessionActivationListener interface in web.xml?
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I did not see anywhere say I have to do for HttpSessionActiveListener. Is it in the spec?
 
Jing Teng
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to do anything in web.xml for HttpSessionBindingListener.
 
ronald spamer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note: The Servlet 2.3 specification contains the javax.servlet.http.HttpSessionBindingListener and the javax.servlet.http.HttpSessionActivationListener interfaces. These interfaces are implemented by objects that are stored as session attributes and do not require registration of an event listener in web.xml. For more information, see the Javadocs for these interfaces.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic