• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javaranch mock exam

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Given



My answer: D
The answer given: A

Is it true in current spec? please advice
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic