On Friday 20 August 2010, Christopher Schultz wrote:
> David,
>
> On 8/20/2010 11:27 AM, David Goodenough wrote:
> > On Friday 20 August 2010, Pid wrote:
> >> The url-pattern must start with a '/' character.
> >>
> >> Please post the complete application web.xml.
> >
> > Actually from reading the source the pattern MUST contain a wildcard.
>
> You must have read it wrong: the spec requires that the followup
> url-patterns be supported:
>
> "
> SRV.11.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 ‘/*’ suffix
> is used for path mapping.
> • A string beginning with a ‘*.’ prefix is used as an extension mapping.
> • A string containing only the ’/’ character indicates the "default"
> servlet of the application. In this case the servlet path is the request
> URI minus the context path and the path info is null.
> • All other strings are used for exact matches only.
> "
>
> > Simple explicit matches do not work, at least not on 6.0.28.
>
> That would be a horrible bug.
Well the validate routine seems to exhibit the bug.
private boolean validateURLPattern(String urlPattern) {
if (urlPattern == null)
return (false);
if (urlPattern.indexOf('\n') >= 0 || urlPattern.indexOf('\r') >= 0) {
return (false);
}
if (urlPattern.startsWith("*.")) {
if (urlPattern.indexOf('/') < 0) {
checkUnusualURLPattern(urlPattern);
return (true);
} else
return (false);
}
if ( (urlPattern.startsWith("/")) &&
(urlPattern.indexOf("*.") < 0)) {
checkUnusualURLPattern(urlPattern);
return (true);
} else
return (false);
}
seems to me not to allow for anything without either a leading / or
a *. checkUnusualURLPattern does not help either.
>
> Seriously, can you post your web.xml? You might have something else
> interfering with the mapping.
Just changing it to a wildcard fixed it. The only thing I changed was the
<uri-pattern> tag, from "page.htm" to "*.htm".
>
> Also, do you have another component in the environment, such as
Apache
> httpd?
As Tomcat was throwing exceptions when it loaded the web.xml
I doubt the any other component could cause it. But no, no other
components, raw Tomat.
David
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]