Skip to content

Commit

Permalink
evolve(demo1): make literal values configurable in another properties…
Browse files Browse the repository at this point in the history
… file
  • Loading branch information
chengcyber committed Dec 25, 2017
1 parent 0352b66 commit 99af760
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spring-demo-1/src/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<!-- load the properties file: sport.properties -->
<context:property-placeholder location="classpath:sport.properties" />

<!-- Define your beans here -->

<bean id="myFortuneService"
Expand All @@ -27,8 +30,8 @@
<property name="fortuneService" ref="myFortuneService"></property>

<!-- set up literal value injection -->
<property name="emailAddress" value="whatever@email.com"></property>
<property name="team" value="spring core team"></property>
<property name="emailAddress" value="${foo.email}"></property>
<property name="team" value="${foo.team}"></property>
</bean>
</beans>

Expand Down
2 changes: 2 additions & 0 deletions spring-demo-1/src/sport.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foo.email=myeasycoach@demo.com
foo.team=Royal Challengers Bangalore

0 comments on commit 99af760

Please sign in to comment.