• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Two questions

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Anyone got answers?

1) Which of the 8 Listener classes must be defined in the web.xml to be used?

2) Does a tld in the META-INF directory of a .jar have to be named 'taglib.tld' because the ones on page 476 HF are NOT!

cheers,
john
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,

1. Except the class implementing "HttpSessionBindingListener", all listener classes need to be registered in web.xml.

2. JSP 2.0 specification says: JSP 1.1 allowed only single tld i.e. /META-INF/taglib.tld for a packaged (jar) tag libraries. But since JSP 1.2 you can have multiple tlds in META-INF directory. So you can have any name for your tld file as long as ".tld" extension is present.

Alankar Yannam
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey John,


Which of the 8 Listener classes must be defined in the web.xml to be used?


Classes implementing interfaces other than 'HttpSessionBindingListener' and 'HttpSessionActivationListener' need to be declared in DD.

best regards,
Radhika
 
John Summers
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mmmm two different answers here!

i think we can agree that HttpSessionBindingListener doesn't need to be in web.xml but what about HttpSessionActivationListener? i think possibly it Does.....? anyone?

john
 
Radhika Jonnalagadda
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
Here is the description.It is an excerpt from Whizlabs Exam Simulator.

The HttpSessionBindingListener and HttpSessionActivationListener are not configured in the deployment descriptor. The HttpSessionBindingListener interface is implemented by the classes whose objects need to receive notifications whenever they are added to or removed from a session. We do not need to inform the container about these objects through the deployment descriptor because the container introspects the interfaces implemented by them and calls the corresponding notification methods. Similarly the SessionActivationListener interface is used by the session attributes to receive notifications when a session is being migrated from one JVM to another. Other than these two interfaces, all the other listeners need to be configured in the deployment descriptor.

hope this information helps.
best regards,
Radhika
 
John Summers
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok! i believe you.

thank you for this.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
I agree with Radhika that HttpSessionBindingListener and HttpSessionActivationListener are not needed to configure.
Lot of people get confusion on this, because in HFSJ book it is given like only HttpSessionBindingListener is not needed to configure in web.xml.
But this is corrected in HFSJ errata
HFSJ errata
 
reply
    Bookmark Topic Watch Topic
  • New Topic