tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Bahavior of url-pattern in Tomcat 5.0.2
Date Mon, 30 Jun 2003 15:32:16 GMT

Howdy,
See SRV.11.2.  Your Test #2 matches with bullet #2 in that spec section,
while your test #3 matches with bullet #4.  That hyphen character makes
a world of difference.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Joe Reger, Jr. [mailto:joe@joereger.com]
>Sent: Monday, June 30, 2003 11:19 AM
>To: tomcat-user@jakarta.apache.org
>Subject: Bahavior of url-pattern in Tomcat 5.0.2
>
>
>Hi!
>
>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 (*.joetest.foo)?
>
>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?
>
>Thanks,
>
>Joe
>
>
>Test 1 -------------------------------
>(Basic example.)
><servlet-mapping>
>    <servlet-name>joetest</servlet-name>
>    <url-pattern>/joetest</url-pattern>
></servlet-mapping>
>This works for URL: http://localhost/myapp/joetest
>
>Test 2 -------------------------------
>(Basic wild card mapping to servlet.)
><servlet-mapping>
>    <servlet-name>joetest</servlet-name>
>    <url-pattern>*.joetest</url-pattern>
></servlet-mapping>
>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.)
><servlet-mapping>
>    <servlet-name>joetest</servlet-name>
>    <url-pattern>*-foo.joetest</url-pattern>
></servlet-mapping>
>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.)
><servlet-mapping>
>    <servlet-name>joetest</servlet-name>
>    <url-pattern>/*-foo.joetest</url-pattern>
></servlet-mapping>
>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.)
><servlet-mapping>
>    <servlet-name>joetest</servlet-name>
>    <url-pattern>*.joetest.foo</url-pattern>
></servlet-mapping>
>Does NOT work for: http://localhost/myapp/6872434ef.joetest.foo
>Does NOT work for: http://localhost/myapp/*.joetest.foo
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message