Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Is this legal url-pattern value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is this legal url-pattern value?" Watch "Is this legal url-pattern value?" New topic
Author

Is this legal url-pattern value?

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
<url-pattern>myServlet</url-pattern>

Is this a legal value for <url-pattern>. I tested with tomcat and it throws an exception when I deploy. But, I just don't understand why this is the case. In servlet spec 11.2 point 4, it says "all other strings are used for exact matches only". So why this cannot be matched with url "http://myhost/myapp/myServlet" - isnt that an exact match?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Try:


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Yes, I know the slash is what makes thing work. But, I just want to know why we can't do without a slash?
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Yes, I know the slash is what makes thing work. But, I just want to know why we can't do without a slash?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There is a link to the servlet spec in my signature.
Section SRV.11.2 explains the sytnax for mappings.

I think it will answer your question and then some.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Alec Lee:
In servlet spec 11.2 point 4, it says "all other strings are used for exact matches only".


Here they are talking about the absolute ones.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this legal url-pattern value?