java.lang.IllegalArgumentException: Invalid
|
1 2 3 4 5 6 7 8 9 10 | <servlet> <servlet-name>myservlet</servlet-name> <servlet-class>workflow.WDispatcher</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>*NEXTEVENT*</url-pattern> </servlet-mapping> |
上面是Tomcat
java.lang.IllegalArgumentException: Invalid
in servlet mapping
如果有人可以提示错误,将不胜感激。
-------------------------------
1 | <url-pattern>*NEXTEVENT*</url-pattern> |
网址格式无效。 它可以以星号结尾或以一个星号开头(表示文件扩展名映射)。
url-pattern规范:
- 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.
有关更多详细信息,请参见Java Servlet规范版本3.1的12.2节。
一种可以实现的解决方法是添加Servlet过滤器以进行URL重写,例如
将NEXTEVENT重新写入/ NEXTEVENT /(NEXTEVENT之前的一个)/(NEXTEVENT之后的一个)或类似的内容。