Spring Boot
Spring 정적 리소스 맵핑
상국이
2022. 2. 27. 14:48
728x90
- 기본 리소스 위치
- classpath:/static
- classpath:/public
- classpath:/resources/
- classpath:/META-INF/resource/
> 위 경로에 요청에 해당하는 리소스가 있다면 자동으로 매핑하여 리턴
ex) https://localhost:8080/hello.html 이라는 요청시 /static/hello.html이 있는 경우 해당 리소스를 리턴
* 맵핑설정을 변경하고 싶은 경우
spring.mvc.static-path-pattern=/sangguk/**
이제는 https://localhost:8080/hello.html > https://localhost:8080/sangguk/hello.html 으로 요청해야함
728x90