• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javaranch mock exam

 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Given



My answer: D
The answer given: A

Is it true in current spec? please advice
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Order matters in web.xml, this order is required:

context-param
listener
servlet
servlet-mapping
session-config
welcome-file-list
taglib
security-constraint
login-config

And in your example servlet is coming before listener so this won't be compile
[ July 06, 2005: Message edited by: Pawan Ramchandani ]
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks
 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
Radmika
 
shri mon
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the <servlet-mapping> tag is missing.
That is why we are having the parse error.

Thanks,
Shrimon.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic