Reputation:
I am trying to learn Struts2. When I see the web.xml file for Struts2 in some of the sites it's mentioned as:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
and where as in some examples its mentioned as:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
Could anybody please help me? What is correct and why is it there are two approaches?
Thank you very much.
Upvotes: 1
Views: 523
Reputation: 23587
Basically StrutsPrepareAndExecuteFilter
been introduced due to variety of reasons
for further information follow the below mentioned thread
New filter strategy RFC Struts2
Upvotes: 2
Reputation: 1112
The FilterDispatcher (org.apache.struts2.dispatcher.FilterDispatcher) it’s deprecated since Struts 2.1.3
. It’s always recommend to use StrutsPrepareAndExecuteFilter
Upvotes: 5