• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question Bank ID : 52

 
Peter Masreblta
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Question Bank ID : 52 Section 3 - The Servlet Container Model
<web-app>
<listener>
<listener-class>com.javaranch.LogListener</listener-class>
</listener>
<servlet>
.....
</servlet>
</web-app>
The above entry in the Deployment Descriptor(DD) will result in which of the following?

A. The webapp will not be loaded due to a parse exception of the DD.
B. Provide a Log Servlet for the entire application.
C. Log all session information as they occur.
D. Create a listener as defined by the com.javaranch.LogListener class.
My answer: D
The answer given: A
The reason: The ordering of the DD is servlet then listener.
I thought the order is given as:
<!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?,
mime-mapping*, welcome-file-list?, error-page*, taglib*,
resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*,
env-entry*, ejb-ref*, ejb-local-ref*)>
Where am I wrong?
Thanks
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. I changed my mind in the middle of creating the question. Nice catch. I corrected it.
Thank You,
Carl
 
Peter Masreblta
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Carl.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic