上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: spring对于事务异常的处理//unchecked 运行期Exception spring默认会进行事务回滚 比如:RuntimeException//checked 用户Exception spring默认不会进行事务回滚 比如:Exception如何改变spring的这种默认事务行为?可以通过在方法上添加@Transactional(noRollbackFor=RuntimeException.class)让spring对于RuntimeException不回滚事务添加@Transactional(RollbackFor=Exception.class)让spring对于Exceptio 阅读全文
posted @ 2012-08-12 16:57 xzf007 阅读(802) 评论(0) 推荐(0) 编辑
摘要: ************************beans.xml************************<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframe 阅读全文
posted @ 2012-08-12 16:27 xzf007 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 注解方式*******************beans.xml*******************<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.o 阅读全文
posted @ 2012-08-06 15:28 xzf007 阅读(247) 评论(0) 推荐(0) 编辑
摘要: ctrl+shift+f:格式化源码ctrl+shift+o:去除无用的引用f3:定位到类源码f4:查看类层次图 阅读全文
posted @ 2012-08-06 15:14 xzf007 阅读(123) 评论(0) 推荐(0) 编辑
摘要: spring中aop功能的实现实际上是用cglib和jdk实现的,如果目标对象实现了接口那么用的是Jdk的方式实现,如果目标对象没有实现接口那么用的是cglib的方式实现。*******************PersonService.java*******************package blog.service; public interface PersonService { public String save(String name); public String update(String name,Integer userId); } *************... 阅读全文
posted @ 2012-08-05 16:24 xzf007 阅读(243) 评论(0) 推荐(0) 编辑
摘要: ************beans.xml************<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context& 阅读全文
posted @ 2012-08-04 17:51 xzf007 阅读(153) 评论(0) 推荐(0) 编辑
摘要: @Autowired默认按类型装配,它有一个required属性,默认为true,意思是这个字段或属性必须被装配,否则会报字段或属性装配异常,如果required设为false则可以将此字段或属性设置为null@Qualifier("personDao") 这个注解和@Autowired一起使用表示按名称进行查找@Autowired(required=true) @Qualifier("personDao") 阅读全文
posted @ 2012-08-04 16:57 xzf007 阅读(236) 评论(0) 推荐(0) 编辑
摘要: beans.xml:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocatio 阅读全文
posted @ 2012-07-29 17:17 xzf007 阅读(134) 评论(0) 推荐(0) 编辑
摘要: package blog.service.impl; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import blog.dao.PersonDao; import blog.service.PersonService; public class PersonServiceBean ... 阅读全文
posted @ 2012-07-29 16:45 xzf007 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2012-07-28 17:42 xzf007 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页