struts升級到2.5.2遇到的問題及解決方案(推薦)_java
阿新 • • 發佈:2019-02-04
原來的版本是2.3.x,由於安全原因需要升級到2.5.2。
1,2.5.2版本不再提供xwork.jar ,整合到了 struts-core包中。
2,方法不能訪問的問題,需要在每個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失效的問題,針對weblogic server,增加session-descriptor節點:
<?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升級到2.5.2遇到的問題及解決方案(推薦),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回覆大家的。在此也非常感謝大家對雲棲社群網站的支援!
以上是雲棲社群小編為您精心準備的的內容,在雲棲社群的部落格、問答、公眾號、人物、課程等欄目也有的相關內容,歡迎繼續使用右上角搜尋按鈕進行搜尋struts 升級到2.5.2 struts2升級到2.5、struts2 2.3 升級2.5、struts2.1.8升級2.5、struts2.3升級到2.5、升級struts2.5.8,以便於您獲取更多的相關知識。