Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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.
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic