要学习这篇文章,首先你得下载hibernate3.jar ,并且下载支持hibernate3的spring framework(最新的),以及相应的struts.jar包 并加载到/web-info/lib下;或者添加到构建路径也可以,当一切准备就绪的时候,就可以学习这篇文章了
(待续)
问题一:applicationContext_hibernate.xml 和applicationContext_service.xml中找不到 "sessionFactory" Bean
applicationContext_hibernate.xml:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
........
</bean>
applicationContext_service.xml:引用上面定义的"sessionFactory"
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
解决办法:@servlet2.4才能用web.xml中的listener加载配置文件
@检查和配置文件有关的类,一个字母也不能错
最近太忙了,都没有时间更新
我写了另外一篇可以参考(基本上都是一样的),这篇就不继续了 :)
Struts+Spring+Hibernate+myEclipse+sqlserver2000 小实例 (测试可运行 增加用户)
http://blog.csdn.net/coolwzjcool/archive/2007/08/07/1729496.aspx