Search in sources :

Example 1 with SpringPropertyInjectSupport

use of com.jim.framework.configcenter.spring.SpringPropertyInjectSupport in project jim-framework by jiangmin168168.

the class WebApplicationConfig method properties.

@Bean
public static PropertyPlaceholderConfigurer properties() {
    SpringPropertyInjectSupport springPropertyInjectSupport = new SpringPropertyInjectSupport();
    springPropertyInjectSupport.setConfigNameSpaces("configcenter/" + System.getProperty("env"));
    springPropertyInjectSupport.init();
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    Resource[] resources = new ClassPathResource[] { new ClassPathResource("application.properties") };
    ppc.setLocations(resources);
    ppc.setIgnoreUnresolvablePlaceholders(true);
    return ppc;
}
Also used : PropertyPlaceholderConfigurer(org.springframework.beans.factory.config.PropertyPlaceholderConfigurer) ClassPathResource(org.springframework.core.io.ClassPathResource) Resource(org.springframework.core.io.Resource) ClassPathResource(org.springframework.core.io.ClassPathResource) SpringPropertyInjectSupport(com.jim.framework.configcenter.spring.SpringPropertyInjectSupport) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SpringPropertyInjectSupport (com.jim.framework.configcenter.spring.SpringPropertyInjectSupport)1 PropertyPlaceholderConfigurer (org.springframework.beans.factory.config.PropertyPlaceholderConfigurer)1 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1 ClassPathResource (org.springframework.core.io.ClassPathResource)1 Resource (org.springframework.core.io.Resource)1