Struts2、Spring2、Hibernate3整合过程中,启动Tomcat6.0的时候报Action class [insertcategoryAction] not found - action - file:/D:/Tomcat%206.0/webapps/SSH2Web/WEB-INF/classes/struts.xml:13:86 我的代码如下:
struts.xml中
<struts>
<include file="struts-default.xml"></include>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="ssh2" extends="struts-default">
<action name="insertcategory" class="insertcategoryAction" method="insertcategory">
<result name="success">/jsp/insertcategory.jsp</result>
</action>
</package>
</struts> spring中的
<bean id="insertcategoryAction" class="action.CategoryAction">
<property name="categorydao">
<ref bean="categorydao"/>
</property>
</bean>
这个错误应该是struts.xml文件中找class属性里的Action时出错了,请问除了把struts.xml中action的class属性名跟spring(applicationContext.xml)中bean的id属性名配成一样的,还有什么地方需要配置的?
struts.xml中
<struts>
<include file="struts-default.xml"></include>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="ssh2" extends="struts-default">
<action name="insertcategory" class="insertcategoryAction" method="insertcategory">
<result name="success">/jsp/insertcategory.jsp</result>
</action>
</package>
</struts> spring中的
<bean id="insertcategoryAction" class="action.CategoryAction">
<property name="categorydao">
<ref bean="categorydao"/>
</property>
</bean>
这个错误应该是struts.xml文件中找class属性里的Action时出错了,请问除了把struts.xml中action的class属性名跟spring(applicationContext.xml)中bean的id属性名配成一样的,还有什么地方需要配置的?
解决方案 »
- 关于在类里弹出JS对话框
- myeclipse中的小问题
- 师兄帮我介绍下
- 求教一段树形算法
- 如何当前时间加一天
- 如何在一个xml文档中提取某个元素的所有内容,不带命名空间?
- 懂xml的朋友来帮忙解决个关于schema的问题啊,谢谢了。
- java应用部署到linux上的ias10g上面的中文乱码问题,oracle10g应用服务器的资料太少了啊...
- J2EE中最头疼的问题被我碰到了,看看CSDN真的是不是这么强,是不是有强人,有史以来最难回答的技术问题,在线待待解决
- 怎样从从一个服务器上(URL中)得到一个XML文件??
- double类型四舍五入到小数点后一位。
- [200分]求大侠那里有hibernate的详细配置和所名(最好能用呀,项目急用)!
试一下在class里写完整个包名
一起学习……
<action path="/login" name="loginForm" scope="request"
input="/index.jsp" validate="true"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/admin/teacher.htm?method=dispart"/>
</action><bean name="/login"
class="com.huayiluo.struts.action.LoginAction">
<property name="validate">
<ref bean="validateServices" />
</property>
</bean>
<action name="strutsspringlogin" class="1">
<result name="success">/resultLoginSS.jsp</result>
<result name="input">/login3.jsp</result>
</action>
applications.xml
<bean id="2" class="com.test.service.impl.LoginServiceImpl"></bean><bean id="1" class="com.test.action.LoginSpringAction" scope="prototype">
<property name="loginService">
<ref local="2"/>
</property>
</bean>不要忘了在struts2现在的包里面lib目录下找见struts2-spring-plugin-2.0.11.jar,加载在MyEclipse中