action管理方式

          1struts.action.extension可以修改請求后綴
          在struts.xml中使用
          <constant name="struts.action.extension" value="do,action"/>
          struts.xml中和struts.properties中可以配置常量,最好在struts.xml中定義
          struts-default.xml
          struts-plugin.xml
          struts.xml
          struts.properties
          web.xml
          重復定義常量,后面的常量值會覆蓋前面的常量

          2<constantname="struts.i18n.encoding" value="UTF-8"/>
          參數作用于setCharacterEncoding方法 freemarker的輸出

          系統自動重新加載
          <constantname = "struts.configuration.xmlreload"/>

          創建spring負責創建actin對象
          <constantname = "struts.objectFactory"/>
          限制上傳文件大小
          <constantname = "struts.multipart.maxSize" value="10838274"/>
          3處理流程 action的管理方式
          用戶請求--》strutsprepareAndExecuteFilter---》
          inerceptor,struts2d內置的一些攔截器---》
          用戶編寫action類---》result進行跳轉---》jsp、html---》瀏覽器響應
          包唯一的
          4,指定多個struts文件
          <struts>

          <constant name="struts.action.extension" value="do,action"/>
              <include file="department.xml" />
              <include file="employee.xml" />
             
          </struts>
          employee.xml如下:
          <?xml version="1.0" encoding="UTF-8" ?>
          <!DOCTYPE struts PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
              "http://struts.apache.org/dtds/struts-2.0.dtd">

          <struts>
              <package name="employee" namespace="/control/employee" extends="struts-default">
                  <action name="helloWord" class="cn.itcast.action.HelloWorldAction" method="execute" >
                      <param name="savepath">/employee</param>
                      <result name="success">/WEB-INF/page/message.jsp</result>
                  </action>
                      
              </package>
          </struts>

          posted on 2012-06-04 23:04 youngturk 閱讀(214) 評論(0)  編輯  收藏 所屬分類: struts2

          <2012年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導航

          統計

          公告

          this year :
          1 jQuery
          2 freemarker
          3 框架結構
          4 口語英語

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          EJB學習

          Flex學習

          learn English

          oracle

          spring MVC web service

          SQL

          Struts

          生活保健

          解析文件

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 伊川县| 渝北区| 东乡| 西青区| 吕梁市| 周至县| 黄石市| 永川市| 郯城县| 九寨沟县| 双牌县| 习水县| 南华县| 襄汾县| 洛南县| 游戏| 锡林浩特市| 太原市| 青浦区| 文成县| 邢台市| 通道| 错那县| 宾阳县| 鲁山县| 河西区| 思茅市| 政和县| 门头沟区| 眉山市| 浙江省| 镇康县| 永泰县| 庄浪县| 淮北市| 潢川县| 湟中县| 绥阳县| 乌恰县| 正镶白旗| 湖州市|