隨筆-153  評論-235  文章-19  trackbacks-0
                今天,師弟開發時有遇到一個小問題:struts表單點取消時,出現org.apache.struts.action.InvalidCancelException異常,弄了一陣子,發現用了validate="true"就會出現此異常。然后找到 freiberg 的博客。

          說到用

          <set-property property="cancellable" value="true"/>

          可以解決,馬上復制去試下,行喔,^_^。

          ---------------------------------引用--------------------------------------

          Any existing applications that use the Cancel processing will need to modify their struts-config.xml to set the cancellable property for actions which require it.

          In Struts 1.2.9 the <set-property> is used to set the cancellable property for an action....

              <action path="/fooAction"
          input="/foo.jsp"
          validate="true">
          <set-property property="cancellable" value="true"/>
          <forward name="success" path="/bar.jsp"/>
          </action>
          

          From Struts 1.3.x a new cancellable attribute can be used....

              <action path="/fooAction"
          input="/foo.jsp"
          validate="true"
          cancellable="true">
          <forward name="success" path="/bar.jsp"/>
          </action>
          

          In both Struts 1.2.9 and Struts 1.3.x an exception handler can be configured to handle the InvalidCancelException

              <action path="/fooAction"
          input="/foo.jsp"
          validate="true"
          cancellable="true">
          <forward name="success" path="/bar.jsp"/>
          <exception key="errors.cancel"
          type="org.apache.struts.action.InvalidCancelException"
          path="/foo.jsp"/>
          </action>
          

          ---------------------------------------end-----------------------------------------------------

          剛好我用的是struts是1.2.9的

          原文:http://www.aygfsteel.com/freiberg/archive/2007/10/20/154384.html

          posted on 2007-10-31 16:25 流浪汗 閱讀(1426) 評論(1)  編輯  收藏 所屬分類: JAVA/J2EE

          評論:
          # re: org.apache.struts.action.InvalidCancelException 錯誤問題 2007-12-07 13:56 | freiberg
          謝謝你的回復,大家共同提高,由于出差,回復的實在是晚啊,不好意思。。。  回復  更多評論
            

           
          <2007年10月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          留言簿(14)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          收藏夾

          友情鏈接

          同學鏈接

          學習鏈接

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 560288
          • 排名 - 86

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 正安县| 南华县| 辰溪县| 武强县| 邵阳市| 潢川县| 馆陶县| 广水市| 康保县| 房山区| 扎鲁特旗| 松潘县| 行唐县| 讷河市| 南宁市| 玉林市| 广州市| 宜昌市| 桐梓县| 得荣县| 望城县| 盱眙县| 晋江市| 乌兰察布市| 吉安市| 庄河市| 澄江县| 沂南县| 清徐县| 宜州市| 治多县| 嘉祥县| 渭南市| 遂川县| 永仁县| 尚义县| 黎城县| 太湖县| 兴业县| 临高县| 洞口县|