tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rune Stilling <>
Subject Replacing default servlet using url-mapping
Date Wed, 13 Apr 2016 11:12:05 GMT
Hi list

I have a question regarding the servlet-mapping property in web.xml. Normally a url would
look like this:


As many others I have tried to setup my servlet so that it matches the following:


I’m trying to obtain this by using the following url-mapping:


I have read the answers on these two links:

It’s still not clear to me why this doesn’t work (using Tomcat 7.0)

I’ve have turned on Jersey tracing and this is what I get (on a url like this http://localhost:8080/emner/81.20.00):

X-Jersey-Tracing-004:MATCH       [ ---- /  1,00 ms |  ---- %] Matching path [/]

What’s puzzling to me is that it seems that for some reason my path gets stripped away before
reaching the servlet. I would have expected something like this instead:

X-Jersey-Tracing-004:MATCH       [ ---- / 19,39 ms |  ---- %] Matching path [/emner/81.20.00]

Is it so in Tomcat, that when you use the url-pattern “/“ that the rest of path is ignored
when interpreting the original url? Is it different using other containers?

Could be related to this: <>

With regards,
Rune Stilling
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message