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属性名配成一样的,还有什么地方需要配置的?

解决方案 »

  1.   

    老大,你放struts2-spring那个plugin了吗?
      

  2.   

    ssh整合,struts-spring配置上没有什么关系
      

  3.   

    <action name="insertcategory" class="insertcategoryAction" method="insertcategory"> 
    试一下在class里写完整个包名
      

  4.   

    顶楼上的,class 应该写完整路径,我故意没写完整路径,试了下,也出现同样的问题,呵呵。
    一起学习……
      

  5.   

    很简单的问题
    <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>
      

  6.   

    把struts.xml与ApplicationContext.xml关联起来
      

  7.   

    struts.xml
    <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中
      

  8.   

    需要在你的spring applicationContext.xml文件中定义你的action的bean的属性加上 scope="prototype" .