struts2.3.8的配置问题

1.lib下面加入如下jar包

      strtuts2.3.8 除了基本jar包

      commons-fileupload-1.2.2.jar
      commons-logging-1.1.1.jar
      freemarker-2.3.19.jar
      ognl-3.0.6.jar
      struts2-core-2.3.8.jar
      xwork-core-2.3.8.jar

       还需要导入
       javassist-3.11.0.GA.jar

      以及
      commons-lang3-3.1.jar
      commons-io-2.0.1.jar

2.配置web.xml文件

      在web.xml文件中加入这么一段

       <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>

3.配置struts2.xml文件

      < ?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="struts2" extends="struts-default">
          <action name="login" class="com.wb.struts2.LoginAction">
                  <result name="success">/result.jsp</result>
          </action>

          </package>
      < /struts> 

你可能感兴趣的:(web.xml,struts2.xml,strtutsjar包)