Add missing code snippets (#9228)

This commit is contained in:
sasam0320
2020-05-06 05:28:28 +02:00
committed by GitHub
parent 50208fb013
commit fb5b157ce4
22 changed files with 268 additions and 10 deletions
@@ -3,6 +3,3 @@ spring.properties.refreshDelay=1000
spring.config.location=file:extra.properties
spring.main.allow-bean-definition-overriding=true
database.url=jdbc:postgresql:/localhost:5432/instance
database.username=foo
database.password=bar
@@ -7,10 +7,14 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
>
<context:property-placeholder location="classpath:foo.properties,classpath:bar.properties"/>
<context:property-placeholder location="classpath:foo.properties,classpath:bar.properties, classpath:database.properties"/>
<bean id="componentInXmlUsingProperties" class="com.baeldung.properties.core.ComponentInXmlUsingProperties">
<constructor-arg value="${key.something}"/>
</bean>
<bean id="dataSource" class="com.baeldung.configurationproperties.Database">
<property name="url" value="${jdbc.url}" />
</bean>
</beans>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"
>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:foo.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:foo.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
</beans>
@@ -0,0 +1,3 @@
com.baeldung.url=www.abc.test.com
com.baeldung.jdbc.url=
com.baeldung.timeout-in-milli-seconds=2000
@@ -0,0 +1,4 @@
database.url=jdbc:postgresql:/localhost:5432/instance
database.username=foo
database.password=bar
jdbc.url=jdbc:postgresql:/localhost:5432
@@ -0,0 +1,5 @@
database:
url: jdbc:postresql:/localhost:5432/instance
username: foo
password: bar
secret: foo