티스토리 뷰

반응형

출처 : http://wizardee.tistory.com/105


[스프링] Property파일 핸들링~

스프링에서 프로퍼티 파일을 사용하는 간단한 방법을 역시나 끄적거려 본다..


* /MyProject/src/main/resources/property/config.properties 생성.

접기

config1=config1

config2=config2

config3=config3

접기


* /MyProject/src/main/java/myproject/common/PropertyMessage.java 생성. (요놈이 실제 프로퍼티 파일에 접근하여 키밸류 데이터를 처리하는 녀석임~)

코드보기


* /MyProject/src/main/webapp/WEB-INF/spring/root-context.xml 수정.

코드보기


* 사용예.

코드보기



반응형