tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Question on servlet determination
Date Wed, 24 Apr 2013 20:35:29 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Konstantin,

On 4/24/13 3:56 PM, Konstantin Kolinko wrote:
> 2013/4/24 Christopher Schultz <chris@christopherschultz.net>:
>> 
>> On 4/23/13 11:35 PM, Caldarale, Charles R wrote:
>>>> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com] 
>>>> Subject: Question on servlet determination
>>> 
>>>> <url-pattern>/Servlet1</url-pattern> 
>>>> <url-pattern>/Servlet2</url-pattern>
>>> 
>>> What happens if you try this instead:
>>> 
>>> <url-pattern>/Servlet1/*</url-pattern> 
>>> <url-pattern>/Servlet2/*</url-pattern>
>> 
>> While that should work, the original mapping should work, too.
>> The request for /Servlet1 (plus a slash on the end) should be
>> sent to Servlet1 with pathInfo="/".
>> 
> 
> No. An URL that does not end with "/*" is used for exact matching
> only.
> 
> /foo and /foo/* are two different mappings.
> 
> BTW, 1. in the examples webapp of Tomcat 6 and Tomcat 7 there is 
> RequestInfoExample servlet that you can play around with. E.g.
> 
> http://localhost:8080/examples/servlets/servlet/RequestInfoExample/foo/bar
>
>  Adding an extra "/" works correctly.

I notice that, although the <url-pattern> is
"/servlets/servlet/RequestInfoExample/*", the trailing "/" is not
required in order to get the request mapped properly. That's
surprising to me given that "/foo" and "/foo/*" should be two
different mappings.

I'm specifically looking at the examples in Tomcat 7.0.39.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJReEIQAAoJEBzwKT+lPKRYtLUP/jdO4O/smOvVPL96PJdyk21T
4JPm7qFLk4dNHDnwr0NUwdeEoJBaKwmVSyTMrvLu1FbhUpaUv4jhQtgV5480k27e
fnQhF4vwuyQaR1dOWb3j69m+soqukQHaU9TEVdl70i++gPrez6vra6mlc+FqOhXV
r6/JSPucCHl8zvAeeNBqui5XY4hVgk7HeIO9ko8Jj8qjvLRpUhaaEHuqeL6lI14B
MohH8CALTyRAvTRtsxmJZr/bb7w8nd274c1UkC/X93qBSNoIponck3SVYMaGFmxQ
HzTCnfpIhX60xAOETh3ltbxzXG4/uyW/ay/WkAFst8uOvgXB5BclE4OAOHYHI13k
opCGxg4vuP8ts9OcOTJG1UGa9cMTWwtHnUbbcvY76Y674nMfC45eP1CKXdTRD0AI
sPPnARL6RRfcX7/jsVdF6I+rzKkjq+7mOQhYOJL02PgB/ccfS8ryHHxU5dWNRsmG
OBcKnSHjtgesjb8nq2d35nOKTs9YCxdOoyrS44CGTWWzbEJb5SN/6JNdTYNfV5pJ
6hsUjdylhtnUixxs08QTqonNQJWEB6RjxWFU2neGgk1ytWpBsNMEARPb4CEWs1Do
FVmBDeNsGOYVgW/DloSndUwtig8TP3z0uAsochLUx/8SJg4bkkzm9WP46Enzmog/
3dazWAjtzWd8sy+2mtmS
=c5IT
-----END PGP SIGNATURE-----

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


Mime
View raw message