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.
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.
Joined: Oct 06, 2003
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?
Joined: Oct 13, 2004
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
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