2018年12月31日

Spring boot 梳理 - 在bean中使用命令行参数-自动装配ApplicationArguments

摘要: If you need to access the application arguments that were passed to SpringApplication.run(…​), you can inject a org.springframework.boot.ApplicationAr 阅读全文

posted @ 2018-12-31 10:34 手握太阳 阅读(747) 评论(0) 推荐(0) 编辑

Spring boot 梳理 - SpringApplication

摘要: Web Environment A SpringApplication attempts to create the right type of ApplicationContext on your behalf. The algorithm used to determine a WebAppli 阅读全文

posted @ 2018-12-31 10:13 手握太阳 阅读(161) 评论(0) 推荐(0) 编辑

Spring 梳理 - @Component

摘要: 使用@Component注解,表示该类定义为Spring管理Bean,使用默认value(可选)属性表示Bean标识符。如果不指定标识符,默认为首字母小写类名。例如类UserController的标识符为userController 阅读全文

posted @ 2018-12-31 09:52 手握太阳 阅读(136) 评论(0) 推荐(0) 编辑

Spring 梳理 - @Autowired VS @Resource

摘要: @Autowired顾名思义,就是自动装配,其作用是为了消除代码Java代码里面的getter/setter与bean属性中的property。当然,getter看个人需求,如果私有属性需要对外提供的话,应当予以保留。 这里@Autowired注解的意思就是,当Spring发现@Autowired注 阅读全文

posted @ 2018-12-31 09:49 手握太阳 阅读(293) 评论(0) 推荐(0) 编辑

导航