Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 윤성우 열혈자료구조
- Algorithm
- stream
- C programming
- 알기쉬운 알고리즘
- list 컬렉션
- 윤성우의 열혈 자료구조
- R
- C 언어 코딩 도장
- 이스케이프 문자
- 메모리구조
- 혼자 공부하는 C언어
- Graph
- Serialization
- Selection Sorting
- 이것이 자바다
- Stack
- insertion sort
- s
- JSON
- datastructure
- coding test
- buffer
Archives
- Today
- Total
Engineering Note
[Spring] Static Resource 경로 설정하기 본문
Spring 6.2.11 버전 공식문서를 참고하여 작성하였습니다.
@Configuration
public class WebConfiguration implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**")
.addResourceLocations("/public", "classpath:/static/");
}
}
"/resource"로 시작하는 요청이 있다면 그 다음에 설정된 상대경로 "/public"(루트 아래의 상대경로로 "/public" ), "classpath:/static/"(classpath 경로 아래의 "/static" )에서 리소스를 찾아서 자원을 반환한다.
참고자료 : https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-config/static-resources.html
'Server > Spring' 카테고리의 다른 글
[Spring] @RequestParam (0) | 2025.09.15 |
---|---|
[Spring] @PathVariable, @RequestParam (0) | 2025.08.24 |
[Spring Boot] @DataJpaTest (0) | 2025.07.10 |
[Spring] 스프링 부트 핵심 구성 요소 (0) | 2025.07.05 |
[Spring] @SpringBootApplication 어노테이션 (0) | 2025.07.04 |
Comments