CustomServletConfig > SPRING_DATA_JPA

본문 바로가기

사이트 내 전체검색

뒤로가기 SPRING_DATA_JPA

CustomServletConfig

페이지 정보

작성자 관리자 작성일 24-06-25 15:17 조회 86 댓글 0

본문

fb02d1947a858a6839e0a3c10c047cfc_1719299799_5866.png
 




package web.config;


import org.springframework.context.annotation.Configuration;

import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;

import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration

@EnableWebMvc

public class CustomServletConfig implements WebMvcConfigurer {


@Override

public void addResourceHandlers(ResourceHandlerRegistry registry) {


registry.addResourceHandler("/js/**")

.addResourceLocations("classpath:/static/js/");

registry.addResourceHandler("/img/**")

.addResourceLocations("classpath:/static/img/");

registry.addResourceHandler("/css/**")

.addResourceLocations("classpath:/static/css/");

registry.addResourceHandler("/assets/**")

.addResourceLocations("classpath:/static/assets/");

registry.addResourceHandler("/fonts/**")

.addResourceLocations("classpath:/static/fonts/");

registry.addResourceHandler("/upload/**")

.addResourceLocations("classpath:/static/upload/");

}

}


댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기