1、yaml语法 2、yaml直接给实体类赋值 @ConfigurationProperties(prefix = “person” ):通过这个注解绑定 占位符的使用 注解configurationProperties @ConfigurationProperties(prefix = “person” ) 3、自定义配置文件xxx.properties把里面的值赋值给类 通过注解加载配置文件@PropertySource(Value = “classpath:xxx.properties”),然后通过@Value(“${xxx}”)得到值 4、JSR303数据校验:@Validated