<util:properties id="" location="" />
<util:properties> 태그를 이용하여 Context 파일에 프로퍼티를 등록하여 Java나 JSP 파일에서 호출하여 사용할 수 있다.
<util:properties id="프로퍼티 ID(식별값)" location="프로퍼티 파일 위치/프로퍼티 파일명" />
예)
RootApplicationContext인 root-context.xml 파일
- root-context.xml
// root-context.xml 파일 내 설정
<util:properties id="config" location="classpath:/context/web.properties" />
- src/main/resources/context/web.properties
// src/main/resources/context/web.properties
user.name=obo
- Java 파일 내 사용
@Value("#{config['user.name']}")
- JSP 파일 내 사용
<spring:eval expression="@config['user.name']" />