BAEL-4083 - removed sample with xml context-config

This commit is contained in:
marcodenisi 2020-06-18 17:58:25 +02:00
parent 333dad149f
commit 3cb402ced7
3 changed files with 2 additions and 42 deletions

View File

@ -3,12 +3,10 @@ package com.baeldung.springbootxml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
@Configuration
@EnableAutoConfiguration
@SpringBootApplication
@ImportResource("classpath:beans.xml")
public class SpringBootXmlApplication implements CommandLineRunner {

View File

@ -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());
}
}

View File

@ -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>