properties work
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
package org.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:bar.properties")
|
||||
public class PropertiesWithJavaConfigOther {
|
||||
|
||||
public PropertiesWithJavaConfigOther() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForPropertiesOne.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
public class PropertiesWithXmlConfigOne {
|
||||
|
||||
public PropertiesWithXmlConfigOne() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package org.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForPropertiesTwo.xml")
|
||||
public class PropertiesWithXmlConfigTwo {
|
||||
|
||||
public PropertiesWithXmlConfigTwo() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user