WebMvcConfigurer 설정
package kr.co.insta.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Value("${custom.path.upload}") String uploadpath;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry
.addResourceHandler("/upload/**")
.addResourceLocations("file:///"+uploadpath);
}
}
=====================
application.yml
..
custom:
path:
upload: 'C:\Users\user\tomcat\upload\'
같은내용인데 다르다?;;;;
잘 정리된 내용..
'생존기술_IT > JAVA' 카테고리의 다른 글
[JAVA] ThymeLeaf and JavaScript (0) | 2021.12.28 |
---|---|
[JAVA] vi setenv.sh 설정 (0) | 2021.09.14 |
[JAVA] IntercepterConfig (0) | 2021.09.08 |
[JAVA] 써티피케이션_인터셉터 설정 (0) | 2021.09.08 |
[JAVA] GoogleOTP 연결 컨트롤러 (개인저장용) (0) | 2021.09.08 |