• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A javaranch mock exam question

 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Select 1 correct answer:

<web-app>
<servlet>
.....
</servlet>
<listener>
<listener-class>com.javaranch.LogListener</listener-class>
</listener>
</web-app>

The above entry in the Deployment Descriptor(DD) will result in which of the following?

A. Provide a Log Servlet for the entire application.
B. Create a listener as defined by the com.javaranch.LogListener class.
C. Log all session information as they occur.
D. The webapp will not be loaded due to a parse exception of the DD.

<answer to be posted later>
 
Mark Beavis
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think option B
 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given answer is D.
Given explanation is: listener element needs to be before servlet element.

I just checked the web.xml on servlet spec. It says the order does not matter. So it seems this question is probably out-dated or based on previous versions.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is outdated. The problem with lots of free mocks out there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic