This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes javaranch mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "javaranch mock exam" Watch "javaranch mock exam" New topic

javaranch mock exam

Radmika Arunachalam
Ranch Hand

Joined: Mar 29, 2004
Posts: 45

My answer: D
The answer given: A

Is it true in current spec? please advice
Pawan Ramchandani
Ranch Hand

Joined: Aug 15, 2003
Posts: 78
Order matters in web.xml, this order is required:


And in your example servlet is coming before listener so this won't be compile
[ July 06, 2005: Message edited by: Pawan Ramchandani ]

Pawan Ramchandani<br />*******************************<br />SCJP 1.4<br />SCWCD <br />*******************************<br />Everything is okay in the end. If it's not okay, then it's not the end.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi Radmika,

Your answer is perfectly write. The j2eecertificate exam is based on the old servlet specifications i.e 2.3. In that version of specification the order of elements is important. But as per the Servlet 2.4 servlet specification the order of top elements under <web-app> is not required. I mean you can specify the elements in any order.

Hope it help you.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Sam Sun
Ranch Hand

Joined: Feb 01, 2005
Posts: 60
Yes. It's true. The order doesn't matter. I tried to declare the listener after servlet. It works. Maybe some other reason results in answer A.
Radmika Arunachalam
Ranch Hand

Joined: Mar 29, 2004
Posts: 45
Thanks Friends.. I was trying to find the same in JSP 2.0 SPEC But it was mentioned in servlet 2.4 spec..

Thanks once again..
shri mon
Ranch Hand

Joined: Jan 11, 2005
Posts: 63
I think the <servlet-mapping> tag is missing.
That is why we are having the parse error.

Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi Shri,

Missing <servlet-mapping> element does not give any parse error but it will create a problem when you you try to access the servlet.

I agree. Here's the link:
subject: javaranch mock exam
It's not a secret anymore!