• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Is HttpSessionActivationListener configured in DD?

 
Ranch Hand
Posts: 229
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the HFSJ errata page at:

http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed

There is an error in page 254 of the page, which should read:

"You do NOT configure session binding listeners OR SESSION ACTIVATION LISTENERS in the DD! ... But this is NOT true for the other session related listeners on the previous page. HttpSessionListener and HttpSessionAttributeListener must be registered in the DD, since they're related to the session itself, rather than an individual attribute placed in the session."

The book itself explained that, unlike the HttpSessionBindingListener, the HttpSessionActivationListener should be configured in the DD.

If HttpSessionActivationListener is not configured in the DD, as pointed out in the errata, then how is it configured?

Thanks in advance.
 
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nopes. HttpSessionActivationListener has to be configured in DD. Only HttpSessionBinding listener doesnt need any DD configuration.
 
Edmund Yong
Ranch Hand
Posts: 229
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case, the errata is wrong, isn't it?
 
author
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe the errata slip is right.
It's the object which is a session attribute value which implements this interface.
Here's part of the API doc for HttpSessionActivationListener:
"Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated. A container that migrates session between VMs or persists sessions is required to notify all attributes bound to sessions implementing HttpSessionActivationListener."
It's the objects that do the listening (not the container) - so no need for a DD entry.
 
Edmund Yong
Ranch Hand
Posts: 229
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

That's what I suspected, and I've searched the Internet and found that it's true. HttpSessionActivationListener should NOT be configured in the DD.

But seriously, how can the authors of HFSJ make such an obvious mistake? In this case, the errata should contain a lot more because all the stuff mentioned in 2 or 3 pages in the book about HttpSessionActivationListener are wrong! For example, it mentioned that HttpSessionActivationListener can be implemented by an attribute classes as well as other classes. It should just be attribute classes, right?
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Edmund Yong:
Hi David,

That's what I suspected, and I've searched the Internet and found that it's true. HttpSessionActivationListener should NOT be configured in the DD.

But seriously, how can the authors of HFSJ make such an obvious mistake? In this case, the errata should contain a lot more because all the stuff mentioned in 2 or 3 pages in the book about HttpSessionActivationListener are wrong! For example, it mentioned that HttpSessionActivationListener can be implemented by an attribute classes as well as other classes. It should just be attribute classes, right?



Hi,
read the specification. No problem
 
David Bridgewater
author
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Edmund...

"It should just be attribute classes"
- yes (IMHO).

"how can the authors of HFSJ make such an obvious mistake?"
- even Homer nods!

Best,

David.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Today I've passed the SCWCD exam and I can bet according the exam the HttpSessionActivationListener must be placed in DD. I had to choose one from these listeners which is needed in DD:
HttpSessionBindingListener
HttpSessionActivationListener
HttpSessionTimeoutListener
HttpSessionPassivationListener
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to declare it. An attribute implementing it will be notified.
Both HttpSessionActivationListener and HttpSessionBindingListener do not need to be declared. Objects implenting those will be automatically notified.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think if author can clear such ambiguous questions, itcould be helpful,If such questions were on the exam how shd we answer them?
Shd we choose HTTPSessionActivation Listener shd be declared in DD for exam
as the right option ?
[ October 06, 2006: Message edited by: Venkat Perumalla ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please believe me
 
author
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:
Please believe me



Hi all,

You can believe Satou on this one. The HFS book is in error on this matter as the errata has confirmed. I take personal responsibility for not catching this error during proofing the book before we went to press.

Sincere regards,
Bryan
 
Ranch Hand
Posts: 246
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's still there in the 2nd edition at page 256. Please be careful who are studying from the new edition.

Thanks and regards,

Naveen Katoch
 
Space pants. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic