WebWork 2.2中新增的default-action-ref

          在WebWork 2.2.1中,在配置文件xwork.xml中新增加了了一個元素: default-action-ref,其實這個配置非常簡單,但是很多人不知道,所以簡單介紹一下.

          如果你在xwork.xml里面配置了default-action-ref,那么當xwork中沒有找到對應的action時,默認就會調用default-action-ref指定的action.

          官方的wiki文檔參考這里: http://wiki.opensymphony.com/display/WW/Action+configuration

          配置代碼如下:

          												<package name="myPackage" ....>
                      ...
                      <default-action-ref name="simpleViewResultAction">
                      <!--
                      An example of a default action that is just a simple class
                      that has 3 fields: successUrl, errorUrl, and inputUrl.  This action
                      parses the request url to set the result values.  In the normal case
                      it just renders velocity results of the same name as the requested url.
                      -->
                      <action name="simpleViewResultAction" class="SimpleViewResultAction">
          ????????????<result type="velocity">${successUrl}</result>
          ????????????
          <result name="error" type="velocity">${errorUrl}</result>
          ????????????<result name="input" type="velocity">${inputUrl}</result>
          ????????????
          </action> ... </package>

          但是要注意,一般一個package內配置一個,如果配置多個,就無法預測結果了.

          注意上面的配置,第一個result的name屬性被省略了,webwork會認為它是"SUCCESS".

          WebWork帶的例子里面就有default-action-ref的配置,可以參考.

          ?

          更多細節請閱讀 wiki文檔.

          _____________________________________________
          JavaScud 免費開源平臺 http://www.javascud.org

          posted on 2006-04-11 10:22 Scud(飛云小俠) 閱讀(2023) 評論(0)  編輯  收藏 所屬分類: WEB

          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          導航

          統計

          公告

          文章發布許可
          創造共用協議:署名,非商業,保持一致

          我的郵件
          cnscud # gmail


          常用鏈接

          留言簿(15)

          隨筆分類(113)

          隨筆檔案(103)

          相冊

          友情鏈接

          技術網站

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 泾阳县| 长春市| 溧阳市| 泾川县| 西和县| 白河县| 临颍县| 阿勒泰市| 平顶山市| 吉木乃县| 乌审旗| 灵山县| 开远市| 临沧市| 瑞金市| 嘉鱼县| 通化市| 阿拉善左旗| 甘肃省| 化州市| 新巴尔虎右旗| 察雅县| 龙陵县| 宁强县| 琼海市| 宝坻区| 光山县| 宁津县| 盖州市| 桑日县| 临猗县| 旌德县| 阿勒泰市| 平远县| 拉萨市| 汉阴县| 花莲县| 天祝| 盘锦市| 徐水县| 黎平县|