반응형

Holder

    외부 properties 파일을 이용해서 스프링 빈을 생성하는 방법

    1. XML에서 프로퍼티 설정 12345678910111213141516// xml // properties 파일db.driver=com.mysql.jdbc.Driverdb.jdbcUrl=jdbc:mysql://localhost/spring4fs?characterEncoding=utf8db.user=testdb.password=testColored by Color Scriptercs 태그는 location 속성으로 지정한 프로퍼티 파일로부터 정보를 읽어와 빈 설정에 입력한 플레이스 홀더의 값을 프로퍼티 파일에 존재하는 값으로 변경한다. # place holder는 ${로 시작하고 }로 끝나는 값. 주의 할 점은 서로 다른 xml에서 서로다른 위치에 프로퍼티 파일을 사용한다고 해도 먼저 열린 프로퍼티 값이..

반응형