property work

This commit is contained in:
eugenp
2013-06-01 01:10:08 +03:00
parent dee468a154
commit 52995a5194
5 changed files with 56 additions and 5 deletions
@@ -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();
}
}