1. FilterDispatcher example
...
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
2. StrutsPrepareAndExecuteFilter example
...
<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>
...
The FilterDispatcher (
org.apache.struts2.dispatcher.FilterDispatcher
) is used in the early Struts2 development, and it’s deprecated since Struts 2.1.3.
If you are using Struts version >= 2.1.3, it’s always recommended to upgrade the new filter class – StrutsPrepareAndExecuteFilter (
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
)
No comments:
Post a Comment