关于SSH中,spring和hibernate集成问题
在配置好struts和spring后,我调试过,在jsp页中建立连接 action=“test.do”
< action path="/test" type="org.springframework.web.struts.DelegatingActionProxy" />
< plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> < set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" /> < /plug-in>
在spring配置文件中:
<bean name="/test" class="com.struts.action.TestAction">
</bean>
测试,可以从jsp页找到TestAction.
然后在SS中继续配置Hibernate后,spring配置中加入了信息
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/test"></property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/hibernate/load/Sys.hbm.xml</value>
<value>com/hibernate/sys/Emp.hbm.xml</value></list>
</property>
</bean>
然后测试就不能找到TestAction了 页面提示ServletAction不可用。
我的配置版本是,MyEclipse6.0 Tomcat5.5 Struts 1.2 Spring2.0 Hibernate3.1 请问大虾是不是这种配置不稳定造成的?谢谢