struts2.3.8的配置問題

1.lib下面加入以下jar包 java

      strtuts2.3.8 除了基本jar包 web

      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 apache

       還須要導入
       javassist-3.11.0.GA.jar

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

2.配置web.xml文件 jsp

      在web.xml文件中加入這麼一段 url

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

3.配置struts2.xml文件 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> 
相關文章
相關標籤/搜索