tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Reger, Jr." <>
Subject Bahavior of url-pattern in Tomcat 5.0.2
Date Mon, 30 Jun 2003 15:18:47 GMT


I'm working with the servlet-mapping tag in web.xml running on Tomcat 5.0.2.
In particular, I'm working with the url-pattern schemes.  I've got a simple
"Hello World!"-style servlet that I'm trying to map various URLs to.  Below
I list some samples and my results.

Why does Test 3 fail?  Shouldn't I be able to define a mapping like
*-foo.joetest?  It's very similar to Test 2.

Why does Test 2 work (*.joetest) but Test 5 fail (*

It seems that I can't really use the wildcard character in a traditional
sense.  There are some other rules. If these are desired behaviors, is there
a reference for url-pattern tag rules? 



Test 1 -------------------------------
(Basic example.)
This works for URL: http://localhost/myapp/joetest

Test 2 -------------------------------
(Basic wild card mapping to servlet.)
This works for URL: http://localhost/myapp/89j98jh8hjl.joetest
This works for URL: http://localhost/myapp/anything.joetest
This works for URL: http://localhost/myapp/.joetest

Test 3 -------------------------------
(Adding something other than the . to the right of the wildcard.)
Does NOT work for: http://localhost/myapp/687-foo.joetest
Does NOT work for: http://localhost/myapp/*-foo.joetest
Does NOT work for: http://localhost/myapp/-foo.joetest

Test 4 -------------------------------
(Trying to add the absolute path reference.)
This works for URL: http://localhost/myapp/*-foo.joetest
(Note that the * above is the actual * character typed into the browser.)

Test 5 -------------------------------
(Similar to Test 2 but with a twist.)
Does NOT work for: http://localhost/myapp/
Does NOT work for: http://localhost/myapp/*

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message