spring
文章平均质量分 80
qaaaaa111
这个作者很懒,什么都没留下…
展开
-
spring的<context:annotation-config>和<context:component-scan>区别
区别: 1、<context:annotation-config>:【自动装配】 是用于激活(@Autowired)那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)。 2、<context:component-scan>:【自动注册+装配】<context:component-scan>...原创 2017-11-27 14:17:47 · 160 阅读 · 0 评论 -
spring读取配置文件
1、xml文件中读取配置文件【以数据库的配置为例】 1.1 配置: 方法一:<context:property-placeholder location="classpath:jdbc.properties"/> 方法二: <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans...原创 2018-02-08 11:55:54 · 108 阅读 · 0 评论