This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Two questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Two questions" Watch "Two questions" New topic
Author

Two questions

John Summers
Ranch Hand

Joined: Oct 06, 2003
Posts: 125
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

Joined: Oct 31, 2005
Posts: 6
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

Joined: Oct 13, 2004
Posts: 89
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


best regards,<br />Radhika<br /> <br />Dare to Dream.Care to Achieve.<br />SCJP 1.4, SCWCD 1.4.
John Summers
Ranch Hand

Joined: Oct 06, 2003
Posts: 125
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

Joined: Oct 13, 2004
Posts: 89
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

Joined: Oct 06, 2003
Posts: 125
ok! i believe you.

thank you for this.
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
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


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
 
wood burning stoves
 
subject: Two questions