web.xml里的内容如下:

<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>
    <filter>
        <filter-name>struts-cleanup</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    
    <context-param>  
        <param-name>contextConfigLocation</param-name>  
        <param-value>/WEB-INF/applicationContext.xml,classpath*:applicationContext.xml</param-value>  
    </context-param>
    
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    
struts.xml里的内容如下:

<struts>

<package name="default" extends="struts-default" namespace="/test">

<action name="insertType" class="insertTypeAction" method="insertType">
                  <result name="success">success.jsp</result>
                  <result name="error">failure.jsp</result>
                  <exception-mapping result="errorPage.jsp" exception="ServletException"></exception-mapping>
          </action>
      </package>

</struts>