Add missing code snippets (#9228)
This commit is contained in:
@@ -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
|
||||
+5
-1
@@ -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>
|
||||
+23
@@ -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>
|
||||
+3
@@ -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
|
||||
Reference in New Issue
Block a user