代码改变世界

java简单学习笔记20190122

2019-01-23 09:55  lofe  阅读(223)  评论(0编辑  收藏  举报

自定义配置类加载xml配置文件@ImportSource("classpath:xxxxx.xml")

使用注解方式 @profile配置运行环境,

使用xml方式@profile配置运行环境<beans profile="test">................

使用注解方式加载properties文件,@propertySource("classpath:xxxxx.properties")..

条件化装配bean要实现接口Condition中的matches方式,并在要检测的方法上注解@Conditional(xxxx.class)

Spring表达式EL,

bean的属性和方法,在类的属性中#赋 值,@Value("#{'myname'}"