4 changed files with 22 additions and 6 deletions
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.commons.tools.config; |
||||
|
|
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; |
||||
|
|
||||
|
/** |
||||
|
* desc:应用配置 |
||||
|
* @author lyn |
||||
|
* @date 2020/7/22 14:08 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class ApplicationConfig { |
||||
|
// 设置@Value注解取值不到忽略(不报错)
|
||||
|
@Bean |
||||
|
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { |
||||
|
PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer(); |
||||
|
c.setIgnoreUnresolvablePlaceholders(true); |
||||
|
return c; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue