注意事项:
1,自定义Filter配置filter-mapping时,必须放到struts2即StrutsPrepareAndExecuteFilter或FilterDispatcher上方,否则无效。
实例:一个Filter配置多个Mapping
1,自定义Filter配置filter-mapping时,必须放到struts2即StrutsPrepareAndExecuteFilter或FilterDispatcher上方,否则无效。
实例:一个Filter配置多个Mapping
<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>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>