SPRING+STRUTS2 integration, do a user login test program, with the configuration file fragment
<constant name= "struts.objectfactory" value= "Spring"/>
<package name= "Struts-config" namespace= "/" extends= "Struts-default" >
<action name= "Login" class= "Loginaction" >
<result name= "Frame" >/frame.jsp </result>
</action>
</package>
</struts>
However, the following 500 errors are reported after submitting the form, if the direct write class= "com.system.actionLoginAction" can be executed
Unable to instantiate Action, loginaction, defined for ' login ' namespace '/' Loginaction
Com.opensymphony.xwork2.DefaultActionInvocation.createAction (defaultactioninvocation.java:306)
Com.opensymphony.xwork2.DefaultActionInvocation.init (defaultactioninvocation.java:387)
Com.opensymphony.xwork2.DefaultActionProxy.prepare (defaultactionproxy.java:186)
Org.apache.struts2.impl.StrutsActionProxy.prepare (strutsactionproxy.java:61)
Org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (strutsactionproxyfactory.java:39)
Com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (defaultactionproxyfactory.java:47)
Org.apache.struts2.dispatcher.Dispatcher.serviceAction (dispatcher.java:458)
Org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (executeoperations.java:77)
Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter ( strutsprepareandexecutefilter.java:76)
From the wrong view, Spring failed to create an action for struts2, which could be the cause:
1. Struts2-spring-plugin-2.1.8.1.jar not loaded
2. Package conflict, delete Asm.jar (online speaking)
3.struts or spring config file error (see my "struts2+spring Integration Framework")
4.spring configuration file name error, Spring profile default is Applicationcontext.xml, in Web. XML may be paired with
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/web-inf/applicationcontext-*.xml, classpath*:applicationcontext-*.xml< /param-value>
</context-param>
This article is from the "No Water Fish" blog, please be sure to keep this source http://javaqun.blog.51cto.com/10687700/1704867
500 errors reported after the first consolidated struts2+spring submission form