action管理方式

          1struts.action.extension可以修改請(qǐng)求后綴
          在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
          重復(fù)定義常量,后面的常量值會(huì)覆蓋前面的常量

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

          系統(tǒng)自動(dòng)重新加載
          <constantname = "struts.configuration.xmlreload"/>

          創(chuàng)建spring負(fù)責(zé)創(chuàng)建actin對(duì)象
          <constantname = "struts.objectFactory"/>
          限制上傳文件大小
          <constantname = "struts.multipart.maxSize" value="10838274"/>
          3處理流程 action的管理方式
          用戶請(qǐng)求--》strutsprepareAndExecuteFilter---》
          inerceptor,struts2d內(nèi)置的一些攔截器---》
          用戶編寫action類---》result進(jìn)行跳轉(zhuǎn)---》jsp、html---》瀏覽器響應(yīng)
          包唯一的
          4,指定多個(gè)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) 評(píng)論(0)  編輯  收藏 所屬分類: struts2

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

          導(dǎo)航

          統(tǒng)計(jì)

          公告

          this year :
          1 jQuery
          2 freemarker
          3 框架結(jié)構(gòu)
          4 口語英語

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊(cè)

          EJB學(xué)習(xí)

          Flex學(xué)習(xí)

          learn English

          oracle

          spring MVC web service

          SQL

          Struts

          生活保健

          解析文件

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 武隆县| 黄龙县| 多伦县| 阿瓦提县| 高陵县| 南平市| 湘西| 木里| 罗江县| 甘南县| 大洼县| 长春市| 泗阳县| 郸城县| 许昌市| 阿拉善左旗| 老河口市| 垫江县| 北票市| 古浪县| 罗江县| 饶河县| 湟源县| 武汉市| 康平县| 岑巩县| 丁青县| 十堰市| 象山县| 武宣县| 伊通| 郯城县| 金沙县| 永济市| 含山县| 杂多县| 柞水县| 克什克腾旗| 通山县| 伽师县| 双城市|