@PropertySource(value="classpath:parameter.properties")
1、在主类上加@PropertySource指明文件位置
/** * 用于properties文件占位符解析 * @return */ @Bean public static PropertySourcesPlaceholderConfigurer propertyConfigInDev() { return new PropertySourcesPlaceholderConfigurer(); }
2、占位符解析
@Value("#{'${security.noneSecurityPath}'.split(',')}") private List<String> noneSecurityPath;3、@Value注解指定文件读的值