Struts upgrade to 2.5.2 encountered problems and solutions (recommended) _java

Source: Internet
Author: User

The original version is 2.3.x and needs to be upgraded to 2.5.2 for security reasons.

The 1,2.5.2 version no longer provides Xwork.jar and is integrated into the Struts-core package.

2, the method does not access the problem, you need to add strict-method-invocation= "false" in each action profile:

<package name= "Login" namespace= "/login" extends= "Struts-default" strict-method-invocation= "false" >

and modify the configuration file header to version 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 failure, for WebLogic server, add session-descriptor node:

<?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>

The 4,2.5.2 version of the JDK requires 1.7 5,web.xml

Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

Modified to:

Org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

The above is a small set to introduce the struts upgrade to 2.5.2 encountered problems and solutions (recommended), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.