struts.xml里action的class属性是用spring的actionbean
但对某些action会出现
Invalid action class configuration that references an unknown class
java.lang.ClassNotFoundException
之类的错误
同一个action class,里面的另一个action就正常
具体配置如下:
struts.xml:
<constant name="struts.objectFactory" value="spring" />
<package name="p1" extends="struts-default">
<action name="logintosys" method="execute" class="userAction">
<result>home.jsp</result>
<result name="input">login.jsp</result>
</action>
<action name="logoutfromsys" method="logout" class="userAction">
</action>
</package>
其中的logintosys正常,logoutfromsys出错
applicationContext.xml:
<bean id="userAction" scope="prototype" class="action.UserAction">
<constructor-arg ref="userDAO" />
</bean>
UserAction.java:
package action.UserAction;
...
web.xml:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
--
FROM 218.76.65.*