Unable to instantiate Action, xxxaction, defined for ' xxx ' in namespace '/' Xxxaction

Source: Internet
Author: User
Unable to instantiate Action, xxxaction, defined for ' xxx ' in namespace '/' Xxxaction solution

September 05, 2014? Comprehensive? A total of 401 words? Small size medium big? Comments Off

There are two main reasons for this problem

1, if the project does not use spring, then in the Struts.xml configuration file, the path of the action's class attribute is not complete, it should be the package name. Class Name

2. If the project uses spring, it is that Applicationcontext.xml does not define the bean for this action. The value of the class property of the corresponding action in the strus.xml is the ID of the bean in the spring configuration file, such as:

Applicationcontext.xml

<bean id= "adminaction" class= "Go.derek.action.AdminAction" scope= "prototype" ></bean>

Struts.xml

<action name= "admin" class= "adminaction" method= "Execute" ><result>/admin.jsp</result></ Action>
3. Supplement may also be @controller ("unitaction") unit case-sensitive issues

Unable to instantiate Action, xxxaction, defined for ' xxx ' in namespace '/' Xxxaction

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.