Forums Register Login

jWebPlus mock exam question

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Here is what says DTD
<!ELEMENT listener (listener-class)>
+Pie Number of slices to send: Send
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.
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 769 times.
Similar Threads
Order Of Elements in Deployment Descriptor.
about listener
HttpSessionListener in Tomcat
listener question
Question on Deployment descriptor - Order of Listeners and Servlets
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:35:26.