上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 52 下一页
摘要: 一、 Spring的bean默认是单例的 But sometimes you may find yourself working with a mutable class that does main-tain some state and therefore isn’t safe for reus 阅读全文
posted @ 2016-03-02 18:26 shamgod 阅读(1333) 评论(0) 推荐(1) 编辑
摘要: 一、 The @Qualifier annotation is the main way to work with qualifiers. It can beapplied alongside @Autowired or @Inject at the point of injection to sp 阅读全文
posted @ 2016-03-02 17:28 shamgod 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 一、 假设有如下三个类实现同一个接口,则自动装配时会产生歧义 1 @Component 2 public class Cake implements Dessert { ... } 3 @Component 4 public class Cookies implements Dessert { .. 阅读全文
posted @ 2016-03-02 17:02 shamgod 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 一、用@Conditional根据条件决定是否要注入bean 1. package com.habuma.restfun; public class MagicBean { } 2. package com.habuma.restfun; import org.springframework.con 阅读全文
posted @ 2016-03-02 16:25 shamgod 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 一、 Spring honors two separate properties when determining which profiles are active:spring.profiles.active and spring.profiles.default . If spring.pro 阅读全文
posted @ 2016-03-02 15:57 shamgod 阅读(696) 评论(0) 推荐(0) 编辑
摘要: 一、 DataSource在应用和开发环境的产生方式不同,可以用srping 的profile管理 Spring’s solution for environment-specific beans isn’t much different from build-timesolutions. Cert 阅读全文
posted @ 2016-03-02 15:41 shamgod 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 一、在xml中引入xml,用<import> 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w 阅读全文
posted @ 2016-03-02 14:45 shamgod 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1. package soundsystem; import org.springframework.beans.factory.annotation.Autowired; public class CDPlayer implements MediaPlayer { private CompactD 阅读全文
posted @ 2016-03-02 14:28 shamgod 阅读(1956) 评论(0) 推荐(0) 编辑
摘要: 一、注入简单属性 1 package soundsystem.properties; 2 import org.springframework.beans.factory.annotation.Autowired; 3 4 import soundsystem.CompactDisc; 5 impo 阅读全文
posted @ 2016-03-02 10:24 shamgod 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 一.当构造函数有集合时,只能用<CONSTRUCTOR-ARG>,不能用C-NAMESPACE 二、 1. 1 package soundsystem.collections; 2 3 import java.util.List; 4 5 import soundsystem.CompactDisc 阅读全文
posted @ 2016-03-02 09:57 shamgod 阅读(266) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 52 下一页
haha