摘要: 一:java配置: 使用@Bean的initMethod和destoryMethod(相当于xml配置的init-method和destory-method) eg:在配置类中: @Bean(initMehthod="init",destroyMethod="destroy") // initMeh 阅读全文
posted @ 2018-06-30 14:17 酱油君nihao 阅读(194) 评论(0) 推荐(0) 编辑
摘要: EL-Spring 支持在xml和注解中使用表达式,经常涉及调用各种资源的情况,主要在注解@Value的参数上使用表达式 1、普通字符 @Value("字符串") private String arguments; 2、操作系统的属性 @Value("#{systemProperties['os.n 阅读全文
posted @ 2018-06-30 11:00 酱油君nihao 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Scope: Spring容器如何新建Bean实例。 eg:@Scope("prototype") 有以下几种: 1、Singleton:单例,默认配置 2、Prototype: 每次调用新建一个Bean 3、Request: 给每一个http request 新建一个Bean 4、Session: 阅读全文
posted @ 2018-06-30 10:14 酱油君nihao 阅读(143) 评论(0) 推荐(0) 编辑