Spring Boot快速入门---(二)spring boot的项目属性配置及Controller的使用

三、项目属性配置

 

1.@Value

修改application.properties配置文件为application.yml

在其中填写

 

可通过@Value来获取值

 

2.@Component和@ConfigurationProperties

 

四、Controller的使用

扫描二维码关注公众号,回复: 2124708 查看本文章

 

1.Controller

 

2.@RequestMapping和RestController

 

 

猜你喜欢

转载自blog.csdn.net/mind_programmonkey/article/details/81006421