더북(TheBook)

다음으로, XML 파일에 지원 클래스(org.springframework.beans.factory.config.PropertyPlaceholderConfigurer 클래스)와 그 빈 정의를 추가하자. 예제 6-13의 XML 설정 파일을 살펴보자.

 예제 6-13 mydocuments-login-context.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd">

 

<bean id="environmentProperties"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="location" value="classpath:META-INF/data/env_dev.properties" />

</bean>

 

<bean id="login" class="com.apress.isf.spring.service.LoginService">

<property name="username" value="${user.email}" />

<property name="password" value="${user.pass}" />

</bean>

 

<!-- 빈 정의 생략 -->

 

</beans>


신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.