《Spring核心技术与最佳实践》第六天 Spring事务管理,

本文固定链接:http://www.verydemo.com/demo_c143_i29707.html

Spring 2.0核心技术与最佳实践
1.光盘中resin的使用,每个项目自带一个start_resin(配置了resin_home,java_home就可以使用了),双击启动的就是以这个项目为根目录的。运行http://localhost:8080/hello.jsp(hello.jsp就是web下任意一个页面) 
工具文件resin.conf,start_resin放在想要启动的工程中,和web文件夹同级
2.Struts_Spring1例子多看几遍(和Struts例子对照着看,加入了Spring要改三个地方)
3 Struts添加错误
 ActionMessages msgs = new ActionMessages();
            msgs.add("loginfailed", new ActionMessage("errors.login.failed"));
            addErrors(request, msgs);  (Action的方法)

MessageResources.properties
errors.login.failed=Bad username or password.

<html:errors />显 示错误的地方
4hiberate与Spring的结合,
用声明式注入加入事务 transaction
2个地方,xml中加一句<...>
用java5注释   @transactional

 《Spring核心技术与最佳实践》第六章节 Spring事务管理,

....................................................................

猜你喜欢

转载自liumin04702712.iteye.com/blog/2073350