瘋狂

          STANDING ON THE SHOULDERS OF GIANTS
          posts - 481, comments - 486, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          日歷

          <2011年8月>
          31123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          公告

          公眾號:
          QQjava交流群:51374316



          相冊

          搜索

          •  

          積分與排名

          • 積分 - 2844332
          • 排名 - 2

          最新隨筆

          struts2.0.1升級到struts2.2.3遇到的一些語法細節。

          Posted on 2011-08-09 10:23 瘋狂 閱讀(3246) 評論(0)  編輯  收藏 所屬分類: struts
          1.
           ognl 靜態方法處理
          <s:property value="@com.e104.rd.util.DynaEnvConstants@getInt('ROWS_PER_PAGE')"/>
          struts2.0.1 支持
           
          struts2.2.3 默認不支持,需要修改struts.xml
          <constant name="struts.ognl.allowStaticMethodAccess" value="true" />

          2. 參數傳遞的問題
           
          var url = '../Search/ResumeSearchAction_loadResumeList.action?pageNo=<s:property value="pageNo"/> ';
               var param = {
             target : url, 
             method : 'post',
             form: "searchConditionForm",
             div: "resume_list_div"
            }
           
          <form id="searchConditionForm" name="searchConditionForm" method="post" action="">
            <input type="hidden" name="pageNo" id="pageNo" value="1">
            。。。。。。。。。
          </form>
           
          url 后面跟pageNo 參數,form里有pageNo 參數,
           
          struts2.0.1 支持,struts2.2.3 不支持,需要把url后參數刪除,且struts2.2.3 參數傳遞要比前版嚴格
          所以要測試,遇到參數傳遞的問題時候,再修改。

          3.導入actions.xml;
          struts2.0.1: <include file="**\actions.xml"/>
          struts2.2.3:
            <include file="/**/actions.xml"/>
          4.默認攔截器的名字修改:
           struts2.0.1:<interceptor-ref name="token-session">
           struts2.2.3:<interceptor-ref name="tokenSession">

          5.
          struts2.0.1
          <result name="LOGOUT" type="redirect-action">
          struts2.2.3:
          <result name="LOGOUT" type="redirectAction">
          遇到攔截器名字,result type名字不一致,可以去查看
          struts2-core-2.2.3.jar/struts-default.xml

          6.

          <pao:FilterSelect id="jobExp.disTime_origin" name="jobExp.disTime_t" source="DataCode_4" filter="0" locale="#session['test.locale']" headerKey="0" headerValue=" 請選擇 "/>

                   更新成綠色部分

          <pao:FilterSelect id="jobExp.disTime_origin" name="jobExp.disTime_t" source="DataCode_4" filter="{0}" locale="#session['test.locale']" headerKey="0" headerValue=" 請選擇 "/>



          7.

          然后就是 json

                         com.googlecode.jsonplugin.JSONUtil  需要替換   org.apache.struts2.json.JSONUtil




          其他可參考官網

          https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-UpdateDependencies

          轉自:http://accpchf.iteye.com/blog/1128492

          主站蜘蛛池模板: 新邵县| 南通市| 三江| 石首市| 大宁县| 集安市| 荣昌县| 博客| 寿光市| 林西县| 孟州市| 来凤县| 澎湖县| 民丰县| 察哈| 阿克陶县| 将乐县| 萨嘎县| 泸西县| 崇文区| 高台县| 湖北省| 霍邱县| 北川| 荃湾区| 灵山县| 保德县| 乌恰县| 哈密市| 临沂市| 澄城县| 凉城县| 宜春市| 宜兰市| 新巴尔虎右旗| 玉林市| 息烽县| 榆中县| 治多县| 盘山县| 黄浦区|