개요 :
인텔리제이 경우 최초 스프링 기본 구조상
dispatcher-servlet, applicationContext.xml 파일이 WEB-INF 아래에 위치함
파일 위치 변경방법
web.xml
<!-- applicationContext.xml 파일 위치경로를 resources/context/.. 에 설정하겠다 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/context/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- dispatcher-servlet.xml 파일 위치경로를 resources/context/.. 에 설정하겠다 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:context/*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
기존 WEB-INF 아래 파일을 <param-value> 부분보면 classpatch:context/*.xml 로 되어있음
classpatch = resources
resources / context / ... .xml 을 읽겠다란 뜻
'Spring Framework' 카테고리의 다른 글
jsp에서 <%include file="..." %> 사용법 (0) | 2021.10.04 |
---|---|
java 패키지 내에 xml파일 읽어들이기 (0) | 2021.10.04 |
인텔리제이 - jsp에서 css, js 파일경로 참조하기 (0) | 2021.07.18 |
Mybatis - RefreshSqlSession..(새로고침으로 쿼리수정된내용 바로적용) (0) | 2021.05.31 |
Ibatis - RefreshalbeSqlMapClient( 새로고침시 쿼리적용) (2) | 2021.05.31 |