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


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