Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Are Session Activation Listeners configured in DD?

 
Otto Teixeira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

reading HFS&JSP, page 254 says (bottom box): "You do not configure session binding listeners in the DD".
The errata says that should instead say: "You do not configure session binding listeners or session activation listeners in the DD".

But then, on page 261, there is a Dog class that implements both HttpSessionBindingListener and HttpSessionActivationListener.
In the bottom of the page, the listener IS CONFIGURED in the DD, and the box right of it says that is MUST be configured because of the Activation listener.
The errata doesn't say anything about this page.

So, after all, HttpSessionActivationListener's are configured or not in the DD?

I'll probably never use that, but it's in the exam...

Thank you
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would not setup SessionBindingListener in DD. The HttpSession object should take care of this itself. The HttpSession implementation should work something like the following:

 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SessionActivation Listeners are configured in the DD
 
Otto Teixeira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the book is correct and its errata is incorrect?

PS: You read the errata, didn't you?
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Book is correct
 
Edmund Yong
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The errata is correct. Both the HttpSessionBindingListener and HttpSessionActivationListener are NOT configured in the DD. They should be implemented by the attribute class.

But HttpSessionListener and HttpSessionAttributeListener must be
registered in the DD.
 
Otto Teixeira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Edmund,

I actually found the answer from another post, when you asked that question yourself.

Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic