Spring이 정적 자원을 다루는방법

bbangho·2023년 8월 30일

Spring Boot

목록 보기
1/1

https://docs.spring.io/spring-boot/docs/3.1.3/reference/htmlsingle/#web.servlet.spring-mvc.static-content

https://www.baeldung.com/spring-mvc-static-resources

스프링부트에서 static resource를 다루는 방법


Spring Boot는 정적 자원을 /static 컨텐트에서 처리한다.

/public /resources /META-INF/resources 도 가능

정적 리소스 경로 커스터마이징

apllicatio.property에서 spring.web.resources.static-locations을 이용하여 경로를 바꿀 수 있다.

spring.web.resources.static-locations= classpath:/sbd , classpath:/static

해주게 된다면 login.html과 index.html, test.html 다 접근 가능하다.

src/main/resources 가 class path인가보다.

profile
2024. 06.17

0개의 댓글