Meaningless Drivel is fun!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes servlet-mapping question 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 "servlet-mapping question" Watch "servlet-mapping question" New topic

servlet-mapping question

Joe Man
Ranch Hand

Joined: Feb 17, 2002
Posts: 71
i'm confused on what can be assigned to a <url-pattern> inside <servlet-mapping> element. Are the following correct?

Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
Aleks Pascoal

Joined: Jul 16, 2002
Posts: 12
Yes, both are correct. You can use anything starting with a "/", witch refers to the root of application(webapps/yourapplication).
Maha Annadurai
Ranch Hand

Joined: Oct 27, 2002
Posts: 87
I think just a * for <url-pattern> is not enough.
The servlet spec does not say anything specifically for just "*" values.
I tested with Tomcat. It gives 404 error even for index.html under the context root.
Can others comment on it?
Maha Anna
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Seconding Maha Anna here. "/" is the default servlet, "*" is invalid.
- Peter
I agree. Here's the link:
subject: servlet-mapping question
It's not a secret anymore!