Spring使用Annotation后的xml配置
来源:百度文库 编辑:神马文学网 时间:2024/04/25 10:04:22
使用了Annotation之后,Spring的配置"大减肥"了一样,就那么一个,就那么几行...
详细见下:
(整个应用就这么一点就可以了,其他都是自动扫描Annotation的)
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
呵呵,虽然Spring配置减肥了,但是Java类就肥了,其实是把肥肉分到各个Bean中去了...
如果要大规模改动...就悲剧了...
呵呵,个人见解,个人见解...