struts升級到2.5.2遇到的問題及解決方案(推薦)
原來的版本是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節(jié)點:
<?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遇到的問題及解決方案(推薦),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關文章
Resilience4J通過yml設置circuitBreaker的方法
Resilience4j是一個輕量級、易于使用的容錯庫,其靈感來自Netflix Hystrix,但專為Java 8和函數(shù)式編程設計,這篇文章主要介紹了Resilience4J通過yml設置circuitBreaker的方法,需要的朋友可以參考下2022-10-10

