property work
This commit is contained in:
@@ -2,11 +2,9 @@ package org.baeldung.spring.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForProperties.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
public class CoreConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.baeldung.spring.properties;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.core")
|
||||
@PropertySource("classpath:foo.properties")
|
||||
public class PropertiesWithJavaConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
public PropertiesWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.baeldung.spring.properties;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForProperties.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
public class PropertiesWithXmlConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
public PropertiesWithXmlConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user