1) Spring 설정파일에 프로퍼티 파일을 설정
1 2 3 4 5 6 | < beans xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:context = "http://www.springframework.org/schema/context" xmlns:mvc = "http://www.springframework.org/schema/mvc" xmlns:util = "http://www.springframework.org/schema/util" xsi:schemalocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"></ beans > < util:properties id = "db" location = "/WEB-INF/database.properties" ></ util:properties > |
2) JSP에서 프로퍼티 값 불러오기
1 2 | <spring:eval expression= "@db.getProperty('jdbc.password')" ></spring:eval> |
1 | <spring:eval expression= "@db['jdbc.password']" ></spring:eval> |
'IT > Spring' 카테고리의 다른 글
@PostConstruct and @PreDestroy (0) | 2015.08.19 |
---|---|
Root Application Context와 Servlet Context (0) | 2015.08.18 |
Spring @Scheduled 어노테이션 (0) | 2015.07.06 |
WRITTEN BY
- Dukejin
If you don't walk today, you will have to run tomorrow. Try hard, Try hard!
,