一、引用jar包
1. 将下载好的struts下的核心类库复制到/WEB-INF/lib目录下
二、web.xml配置
check your struts2-core-x.x.jar version.
-->if it is struts2-core-2.5.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>
-->if it is struts2-core-2.1.3.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
FilterDispatcher is deprecated since Struts 2.1.3. If you are working with older versions then user above solution.
-->if it is struts2-core-2.3.X.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
时间: 2024-10-26 09:46:28