This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two questions

 
John Summers
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • 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
 
Alankar Yannam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
 
Radhika Jonnalagadda
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
ok! i believe you.

thank you for this.
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic