Posted on 2011-08-09 10:23
瘋狂 閱讀(3235)
評(píng)論(0) 編輯 收藏 所屬分類:
struts
1.
ognl 靜態(tài)方法處理
<s:property value="@com.e104.rd.util.DynaEnvConstants@getInt('ROWS_PER_PAGE')"/>
struts2.0.1 支持
struts2.2.3 默認(rèn)不支持,需要修改struts.xml
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
2. 參數(shù)傳遞的問題
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 參數(shù),form里有pageNo 參數(shù),
struts2.0.1 支持,struts2.2.3 不支持,需要把url后參數(shù)刪除,且struts2.2.3 參數(shù)傳遞要比前版嚴(yán)格 ,
所以要測(cè)試,遇到參數(shù)傳遞的問題時(shí)候,再修改。
3.導(dǎo)入actions.xml;
struts2.0.1: <include file="**\actions.xml"/>
struts2.2.3:
<include file="/**/actions.xml"/>
4.默認(rèn)攔截器的名字修改:
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=" 請(qǐng)選擇 "/>
更新成綠色部分
<pao:FilterSelect id="jobExp.disTime_origin" name="jobExp.disTime_t" source="DataCode_4" filter="{0}" locale="#session['test.locale']" headerKey="0" headerValue=" 請(qǐng)選擇 "/>
7.
然后就是 json
com.googlecode.jsonplugin.JSONUtil 需要替換 org.apache.struts2.json.JSONUtil
其他可參考官網(wǎng)
https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-UpdateDependencies
轉(zhuǎn)自:http://accpchf.iteye.com/blog/1128492