与 Struts2 的 web.xml 文件混淆
我正在努力学习Struts2。当我在某些站点中看到 Struts2 的 web.xml 文件时,它被提到为:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
在某些示例中,它被提到为:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
有人可以帮助我吗?什么是正确的?为什么有两种方法?
非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
FilterDispatcher ( org.apache.struts2.dispatcher.FilterDispatcher) 自
Struts 2.1.3
起已弃用。始终建议使用 StrutsPrepareAndExecuteFilterThe FilterDispatcher (org.apache.struts2.dispatcher.FilterDispatcher) it’s deprecated since
Struts 2.1.3
. It’s always recommend to use StrutsPrepareAndExecuteFilter基本上
StrutsPrepareAndExecuteFilter
的引入是由于各种原因,以获取更多信息,请遵循下面提到的线程
新的过滤策略RFC Struts2
Basically
StrutsPrepareAndExecuteFilter
been introduced due to variety of reasonsfor further information follow the below mentioned thread
New filter strategy RFC Struts2