• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Question Bank ID : 52

 
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
 
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.
 
Die Fledermaus does not fear such a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic