Spring and STRUTS2 Integration error HTTP Status 500-unable to instantiate Action

Source: Internet
Author: User

Spring and STRUTS2 integration in the time because of the effect of a problem encountered, a half-day God finally found the problem, so share out hope that the vast number of Bo friends warning!!

We all know that when spring and struts2 are integrated, Spring takes over the creation of the action object, so be sure to configure the action in the spring configuration file, where you need to be aware of configuring <bean id= "???" > in the ID,

To configure <action class= "???" in Action with Struts.xml >class is consistent, otherwise the following problems will arise:

Landlord is because the Struts.xml configuration action in the class as the action path, resulting in this problem, so the pro must pay attention!

Error configuration code: Applicationcontext.xml <bean id= "cartaction" class= "Com.ansibee.shop.web.action.CartAction" Scope= "Prototype" >

Struts.xml <action name= "cart_*" class= "com.ansibee.shop.web.action.CartAction" method= "{1}" >

Correct configuration code: Applicationcontext.xml <bean id= "cartaction" class= "Com.ansibee.shop.web.action.CartAction" Scope= "Prototype" >

Struts.xml <action name= "cart_*" class= "cartaction" method= "{1}" >

Spring and STRUTS2 Integration error HTTP Status 500-unable to instantiate Action

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.