原來(lái)的版本是2.3.x,由于安全原因需要升級(jí)到2.5.2。
1,2.5.2版本不再提供xwork.jar ,整合到了 struts-core包中。
2,方法不能訪問(wèn)的問(wèn)題,需要在每個(gè)action配置文件中加上 strict-method-invocation="false":
<package name="login" namespace="/login" extends="struts-default" strict-method-invocation="false">
并修改配置文件頭部為2.5版本的:
<!DOCTYPE struts PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN""http://struts.apache.org/dtds/struts-2.5.dtd">
3,session失效的問(wèn)題,針對(duì)weblogic server,增加session-descriptor節(jié)點(diǎn):
<?xml version="1.0" encoding="UTF-8"?><weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"><context-root>/ynwjnw</context-root><container-descriptor><servlet-reload-check-secs>-1</servlet-reload-check-secs><prefer-web-inf-classes>true</prefer-web-inf-classes></container-descriptor><session-descriptor><cookie-name>JSESSIONID1</cookie-name></session-descriptor></weblogic-web-app>
4,2.5.2版本jdk要求1.7 5,web.xml中把
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
修改為:
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
以上所述是小編給大家介紹的struts升級(jí)到2.5.2遇到的問(wèn)題及解決方案(推薦),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選