我有一个Struts2(2.1.8.1)Web应用程序.我的web.xml看起来像,
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)
这配置为将所有请求映射到struts过滤器.我想在我的Web应用程序中添加一个servlet.我想将具有特定url模式的所有请求发送到该servlet.我希望其他所有东西都能进入我的struts servlet.
我知道我只能将"*.action"映射到struts servlet,但我讨厌.action就在我所有URL的末尾.