首页 > 其他 > 详细

商城项目_temp记事本

时间:2019-06-24 23:27:30      阅读:101      评论:0      收藏:0      [点我收藏+]
  1. springboot默认 application.properties application.yml
    
    springboot的四种属性注入:
    1,@Autowired注入
    2,构造方法注入
    3,@Bean方法形参注入
    4,直接在@Bean方法上使用@ConfigurationProperties(prefix="前缀名")
    
    包括@Controller+@ResponseBody
    1,RestController
    开启SpringBoot自动配置
    2,EnableAutoConfiguration
    组件扫描 类似于<context:component-scan base-package=""/> 扫描当前所在包以及子包
    3,ComponentScan
    包括 @EnableAutoConfiguration+@ComponentScan+@SpringBootConfiguration
    4,SpringBootApplication
    springboot配置
    5,SpringBootConfiguration
    配置
    6,Configuration
    指定一个资源文件 @PropertySource("classpath:jdbc.properties")
    7,PropertiesSource
    把方法的返回值注入到spring容器
    8,Bean
    注入指定属性值 需要有setter
    9,Value
    指定配置文件 @ConfigurationProperties(prefix = "jdbc")
    10,ConfigurationProperties
    开启配置 @EnableConfigurationProperties(JdbcProperties.class)
    11,EnableConfigurationProperties

     

商城项目_temp记事本

原文:https://www.cnblogs.com/taopanfeng/p/11080113.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!