Spring学习记录(一)

1.import 引入配置文件:<import resource="conf/partner/partner-spring.xml"></import> 使用相对路径

2.<context:component-scan>

spring可以自动去扫描base-pack下面或者子包下面的java文件,如果扫描到有@Component @Controller@Service等这些注解的类,则把这些类注册为bean(详情查看:http://blog.csdn.net/chunqiuwei/article/details/16115135)

3.<context:annotation-config />(详情查看:http://www.cnblogs.com/iuranus/archive/2012/07/19/2599084.html)

4.<tx:annotation-driven />

对@Transactional这个注解进行的驱动,这是基于注解的方式使用事务配置声明,这样在具体应用中可以指定对哪些方法使用事务.

@Transactional 注解可以被应用于接口定义和接口方法、类定义和类的 public 方法上。

 Spring团队的建议是你在具体的类(或类的方法)上使用 @Transactional 注解,而不要使用在类所要实现的任何接口上。

5.<task:annotation-driven> <task:scheduler> <task:executor> 定时器

6.<context:property-placeholder>  http://blog.sina.com.cn/s/blog_4550f3ca0100ubmt.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章