1、配置struts2主配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="user" namespace="/" extends="struts-default">
<action name="userAction" class="club.ityuchao.web.action.UserAction" method="${1}">
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
2、将struts2核心过滤器配置到web.xml中
<!-- 配置struts2核心过滤器 -->
<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>