springboot读取配置文件 一.读取springboot框架自带的application.properties或application.yml文件.1.通过@Value注解来读取application.properties文件内容:name=1user.name=2读取方式:@Value("${name}")private String name;@Value("${user.name}")private String userName;如果要设置默认值:@Value("${name