본문 바로가기
Develop/Spring

[설정]스프링 설정파일 위치 바꾸기

by jaekk 2018. 8. 15.

1. 설정파일이 위치할 폴더 생성

src>main>resource>Folder



폴더명: spring



spring폴더에 root-context.xml 파일을 옮겨준다.



2. 설정 위치 변경

classpath: src>main


1) web.xml



2) 테스트 파일

root-context.xml(스프링 설정)을 명시한 파일에서 locations 위치 변경


1
2
3
4
5
6
    <!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <!-- <param-value>/WEB-INF/spring/root-context.xml</param-value> -->
        <param-value>classpath:spring/root-context.xml</param-value>
    </context-param>




해당 게시글은 

[스터디]코드로 배우는 스프링

강좌를 토대로 작성하였습니다.

https://www.youtube.com/watch?v=xSWVDTF56UM

댓글