webtier@glassfish.java.net

Re: [webtier] aligned url-pattern in web.xml

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 21 Apr 2009 18:28:54 -0700

Hi Dies,

On 04/21/09 04:59 PM, Dies Koper wrote:
> Hi Jan,
>
> I have a servlet application with a few spaces in the url-pattern, which
> deploys fine on Tomcat, not on GF.
>
> <web-app>
> <servlet>
> <servlet-name>
> AA
> </servlet-name>
> <jsp-file>
> /aa.jsp
> </jsp-file>
> </servlet>
> <servlet-mapping>
> <servlet-name>
> AA
> </servlet-name>
> <url-pattern>
> /*
> </url-pattern>
> </servlet-mapping>
> </web-app>
>
> Deployment (in GFv3-ea-b42) failed with the following message.
>
> message: Exception while deploying the app : java.lang.IllegalArgument
> Exception: Invalid URL Pattern: [
> /*
> ]
> use-main-children-attribute: false
>
> Changing the url-pattern to <url-pattern>/*</url-pattern> fixes the error.
> The Servlet spec says:
>
> URI paths specified in the deployment descriptor are assumed to be in
> URL decoded form. The containers must inform the developer with a
> descriptive error message when URL contains CR(#xD) or LF(#xA). The
> containers must preserve all other characters including whitespace in URL.
>
> Why is it so strict?
> Can't it just catch the exception, do a trim() and try again?
>

Yes, that might be a good idea!

I've seen this problem a few times as people were trying to migrate from
Tomcat to GlassFish.

Let me know if you'd be interested in working on a patch for this.

Thanks!

Jan

> Thanks,
> Dies
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>