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

URL mappings

 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are valid URL mappings to a servlet in a web deployment descriptor?
A */*
B /*.do
C /MyServlet
D scwcd/MyServlet
E /MyServlet/*

To my opinion C, E are correct

Mock Exam Explaination
Answer B,C,E

???Experts Opinion.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*.do this is known as the extension mapping rule as in any request with a .do extension would go to the mapped servlet.
But this rule would come into play only when the other Path mapping rules would fail.
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see what you mean about the /*.do mapping - although it would be nice if this did work, the servlet spec. makes no mention of it being valid. THe relevant paragraphs of section SRV.11.2 of the spec. state:

From Servlet 2.4 spec:

  • A string beginning with a �*.� prefix is used as an extension mapping.
  • ...
  • All other strings are used for exact matches only.
  • So in fact I would assume they've made a mistake and meant to have *.do as option B. In that case it would be correct. As it is, according to the spec., B would be interpreted as the path to the resource called "*.do" under the / root... which seems a bit daft!
     
    Gaurav Gambhir
    Ranch Hand
    Posts: 256
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Charles
     
    Ranch Hand
    Posts: 951
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,

    From Servlet 2.4 spec:

    * A string beginning with a �*.� prefix is used as an extension mapping.
    * ...
    * All other strings are used for exact matches only.



    All the mapping string other than extension mapping must start with /, though it use for exact mapping. Please confirm

    Thanks
     
      Bookmark Topic Watch Topic
    • New Topic