tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Soutter" <ge...@whitewolf.com.au>
Subject Re: repost: contextPath + servletPath + pathInfo = requestURI?
Date Fri, 12 Nov 1999 07:18:50 GMT
Hans Bergsten <hans@gefionsoftware.com> wrote:
>Geoff Soutter wrote:
>>
>> >I'm trying to get tomcat working with a servlet mapped to / (actually /*
as
>> >per the 2.2 spec), in the default context.
>
>I'm not sure "/*" is a valid pattern. To replace the default servlet the
correct
>pattern is just "/" based on the last rule below:
>
>  10.2 Specification of Mappings
>  In the web application deployment descriptor, the following syntax is
used to
>  define mappings:
>  * A string beginning with a '/' character and ending with a '/*' postfix
is
>    used as a path mapping.
>  * A string beginning with a '*.' prefix is used as an extension mapping.
>  * All other strings are used as exact matches only
>  * A string containing only the '/' character indicates that servlet
specified
>    by the mapping becomes the "default" servlet of the application.

Whoops. I must have selective reading to go with my selective memory... :)

>> >anyway, consider the situation where you map a servlet to /*, and you
have
>> a
>> >requestURI = "/blah"
>> >
>> >the current tomcat does the following:
>> >
>> >contextPath = "/"
>> >servletPath = null
>> >pathInfo = "/blah"

[snip]

>My interpretation of the spec is that it should result in this (for the
default
>context):
>
>  contextPath = ""
>  servletPath = "/blah"
>  pathInfo = null

Ah, I get it. This spec is not clear on this point, and IMVVHO it seems, er,
non-optimal. I would have thought having a null or empty servletPath makes a
lot more sense than a null or empty pathInfo in this situation. Certainly
for my particular applications I'll have to add extra code to support this
particular case, but as always I suppose there is a bigger picture that only
those who've written a servlet container can know... :-)

Anyway, thanks for the help Hans! Most appreciated...

Geoff


Mime
View raw message