• 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

mock question regarding servlet mapping

 
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 5. Which are valid URL mappings to a servlet in DD?
a>*/*
b>/*.do
c>/MyServlet
d>scwcd/MyServelt
e>/MyServlet/*

My answer is c> and e? .
But b is also given as a answer.But I think it is wrong because we cant use �/� before * in extension mapping. Am i right?What do you say?



source ont know exactly from where i noted it
[ June 02, 2008: Message edited by: pradeep singh ]
[ June 02, 2008: Message edited by: pradeep singh ]
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say you're right

See the servlet spec 2.4.

SRV.11.2 Specification of Mappings

In the Web application deployment descriptor, the following syntax is used to define
mappings:
� A string beginning with a �/� character and ending with a �/*� suffix is used
for path mapping.
� A string beginning with a �*.� prefix is used as an extension mapping.
� A string containing only the �/� character indicates the "default" servlet of
the application. In this case the servlet path is the request URI minus the context
path and the path info is null.
� All other strings are used for exact matches only.
 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankx
reply
    Bookmark Topic Watch Topic
  • New Topic