tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Question on servlet determination
Date Wed, 24 Apr 2013 19:56:11 GMT
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.

2.Handling of welcome files in Tomcat 7 depends on "strict servlet
compliance" setting (see Migration guide and system properties page in
Configuration reference).

Best regards,
Konstantin Kolinko

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


Mime
View raw message