BAEL-4083 - removed sample with xml context-config
This commit is contained in:
parent
333dad149f
commit
3cb402ced7
|
@ -3,12 +3,10 @@ package com.baeldung.springbootxml;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.ImportResource;
|
import org.springframework.context.annotation.ImportResource;
|
||||||
|
|
||||||
@Configuration
|
@SpringBootApplication
|
||||||
@EnableAutoConfiguration
|
|
||||||
@ImportResource("classpath:beans.xml")
|
@ImportResource("classpath:beans.xml")
|
||||||
public class SpringBootXmlApplication implements CommandLineRunner {
|
public class SpringBootXmlApplication implements CommandLineRunner {
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.baeldung.springbootxml;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.CommandLineRunner;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.ImportResource;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ImportResource("classpath:beansconf.xml")
|
|
||||||
public class SpringBootXmlWithConfigApplication implements CommandLineRunner {
|
|
||||||
|
|
||||||
@Autowired private Pojo pojo;
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(SpringBootXmlWithConfigApplication.class, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run(String... args) throws Exception {
|
|
||||||
System.out.println(pojo.getField());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<beans
|
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns:context="http://www.springframework.org/schema/context"
|
|
||||||
xmlns:p="http://www.springframework.org/schema/p"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
||||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
|
|
||||||
|
|
||||||
<context:property-placeholder location="classpath:application.properties"/>
|
|
||||||
|
|
||||||
<bean class="com.baeldung.springbootxml.Pojo">
|
|
||||||
<property name="field" value="${sample}"></property>
|
|
||||||
</bean>
|
|
||||||
</beans>
|
|
Loading…
Reference in New Issue