티스토리 뷰

 

외부에 저장된 파일을 <img src=""> 로 불러올때는 static resource mapping 설정을 해줘야함

 

여기서 path + profileImage 는 /Users/kingsubin/Desktop/Proejct/soob/files/profileImage/ 이다.

 

그냥 .addResourceLocation("/Users/kingsubin/Desktop/Proejct/soob/files/profileImage/") 이렇게 해줬을때는 안됐는데 

 

찾아보니 앞에 "file:" 을 붙여줘야한다.

 

 

 

 

 

 

'Spring' 카테고리의 다른 글

Spring security 정리  (0) 2021.02.02
spring-security 잘 정리된 글  (0) 2021.02.01
시큐리티 1부~2부  (0) 2020.07.13
데이터 7부 : 데이터베이스 초기화  (0) 2020.07.13
데이터 5~6부 : 스프링 데이터 JPA  (0) 2020.07.12