
说明:使用的是tapestry5.1.0.5 和spring 2.5.6版本。以下问题仅代表我的观点,如果各位大虾有什么好的方法请跟贴告知。
今天我使用tapestry5 集成spring时,想使用事务管理。tapestry5。。于是高高兴兴地进行spring 的配置:配置代理类(TransactionProxyFactoryBean),完后才发现使用不了。。。
经过查询api相关文档,最后才明白,tapestry5的注入方式与spring的注入原理不一样。最后在spring文档的帮助下找到了能使用事务的方法:
1、在spring的配置文件中引入tx与aop的命名空间:

xmlns:aop="http://.springframework.org/schema/aop"
xmlns:tx="http://.springframework.org/schema/tx"
http://.springframework.org/schema/tx/spring-tx-2.5.xsd
http://.springframework.org/schema/aop/spring-aop-2.5.xsd

2、配置事务规则:
3、配置切面
OK,重新布署应用程序,就可以使用了。。。tapestry5
如果对aop与tx的配置有什么不懂的,请查阅spring 文档!
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-27647-1.html
当年electricshock的精灵们回到曾经的森林去寻找回忆