aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jWebPlus mock exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jWebPlus mock exam question" Watch "jWebPlus mock exam question" New topic
Author

jWebPlus mock exam question

Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
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
yi zhu
Ranch Hand

Joined: Sep 10, 2002
Posts: 41
Here is what says DTD
<!ELEMENT listener (listener-class)>
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
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.
 
jQuery in Action, 2nd edition
 
subject: jWebPlus mock exam question
 
Similar Threads
Question on Deployment descriptor - Order of Listeners and Servlets
Order Of Elements in Deployment Descriptor.
about listener
listener question
HttpSessionListener in Tomcat