GlassFish 3.1 and the tag <url-pattern> of web.xml file
I read that into the tag <url-pattern>
I can write a prefix or a suffix pattern url.
But if I try to write something like:
<url-pattern>*sde</url-pattern>
or
<url-pattern>/sde*</url-pattern>
and try to get the url as polsde alsde or sdepp sdelop I have a 404 error and a deploy failed into server log.
What's wron开发者_运维技巧g?
URL-pattern is wrong.
The pattern you have supplied is invalid
The url-pattern specification:
- 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.
- Please refer Java Servlet Specifications
Interesting question! From reading the 3.0 servlet spec, it doesn't look like the wildcard in servlet mappings works the same way as a regex wildcard; there are boundaries to the mapping.
*.sde would be a valid mapping.
So would "/sde/*", but I don't see any mention of embedded wildcards as you're using them. For the Servlet 3.0 specification, see section 12.2.
精彩评论