Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jWebPlus mock exam question

 
Rasika Chitnis
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what says DTD
<!ELEMENT listener (listener-class)>
 
Rasika Chitnis
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic