Framework & Platform/Spring
spring - css, js 파일 처리
linuxism
2012. 12. 8. 15:17
STS가 제공하는 템플릿으로 프로젝트를 생성하면
.css, .js 파일을 어디에 넣어야 할까?
src/main/webapp에 넣어도 DispatcherServlet의 servlet-mapping이 /로 설정되어 404가 발생한다.
WEB-INF/spring/appServlet/servet-context.xml 파일 내 다음 설정을 확인할 수 있다.
<resources mapping="/resources/**" location="/resources/" />
설정에서 보는 바와 같이 src/main/webapp/resources에 넣어주면 되겠다.
Reference:
http://stackoverflow.com/questions/1234298/can-springmvc-be-configured-to-process-all-requests-but-exclude-static-content
출처 - http://devday.tistory.com/2434