日期:2014-05-18  浏览次数:20687 次

struts+hibernate+spring问题,说找不到action,n天没有解决了,高手救命呀!!
小弟我是第一次用strust+hibernat+spring按照网上的一个例子说是找不到action.好多天没有解决,高手帮忙呀。下面我把部分代码贴上来,高手看看。。顺便问一下,web.xml里面用不用配spring的什么东东呀。。。

applicatContext.xml  
   
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   beans   PUBLIC   "-//SPRING//DTD   BEAN//EN "   "http://www.springframework.org/dtd/spring-beans.dtd ">

<beans>


<bean   id= "sessionFactory "   class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property   name= "configLocation ">
<value> classpath:hibernate.cfg.xml </value>
</property>
</bean>
<bean   id= "UserListDAO "   class= "com.jyx.UserListDAO ">
<property   name= "sessionFactory ">
<ref   bean= "sessionFactory "   />
</property>
</bean>
<bean   name= "/user "
        class= "com.jyz.user.action.UserAction ">
        <property   name= "userListDAO ">
            <ref   bean= "UserListDAO "/>
        </property>    
</bean>
</beans>

struts-config.xml

<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   struts-config   PUBLIC   "-//Apache   Software   Foundation//DTD   Struts   Configuration   1.1//EN "   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd ">
             
<struts-config>
    <data-sources   />
    <form-beans   />
    <global-exceptions   />
    <global-forwards   />
    <action-mappings   >
     
          <action       path             =   "/user "
                              type             =   "org.springframework.web.struts.DelegatingActionProxy "
                              validate     =   "false "
                              parameter   =   "method "                      
                                                             
        >
        <forward   name= "success "   path= "/success.jsp "/>
        </action>
 
    </action-mappings>

    <message-resources   parameter= "com.jyx.struts.Application