aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes About servlet-mapping 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 "About servlet-mapping" Watch "About servlet-mapping" New topic
Author

About servlet-mapping

Jack Lau
Ranch Hand

Joined: Aug 30, 2002
Posts: 166
Hello All,

I create an TestServlet and add the following code into web.xml

I expected both (/TestServlet and /test/Testxxx) of them can map to TestServlet but only /TestServlet work properly.

Could anyone tell me why /test/Testxxx cannot (but /test/Test* work)?

Thanks in advance!!
Jack
[ June 21, 2004: Message edited by: Jack Lau ]
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3231
    
    6
howdy,

Let's see what the spec says:



SRV.11.2 Specification of Mappings
In theWeb 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.


so, use either

/bla-bla/*

or

*.bla

but not

/bla-bla*

cheers,
MZ


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Jack Lau
Ranch Hand

Joined: Aug 30, 2002
Posts: 166
Thank you very much

Jack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About servlet-mapping