there is a question on jWebPlus mock exam (it is on the CD that came with the book SCWCD exam study kit) about specifying listener classes in web.xml. I found that the answer I selected was wrong. My answer was : <listener> <listener-class>MyServletContextAttributeListener</listener-class> <listener-class>MyHttpSessionListener</listener-class> </listener> the correct answer was : <listener> <listener-class>MyServletContextAttributeListener</listener-class> </listener> <listener> <listener-class>MyHttpSessionListener</listener-class> </listener> I would like to know why the first one is wrong. thanks
Here is what says DTD <!ELEMENT listener (listener-class)>
Joined: Jun 19, 2001
thanks, got you. In fact after careful reading found out on page 87 of the SCWCD exam study kit. it says <listener> element contains one and only one <listener-class> element. This seems unnecessary though. Why can't we use same <listener> element for specifying all <listener-class> elements ? thanks, any way.