Spring에서는 xml에서 따로 리소스 경로를 입력해줘야한다.
하지만 SpringBoot는 spring-boot-starter-web에서 이런 작업을 대신해주기 때문에 아래와 같이 간편하게 사용가능하다.

src/main/resources/sratic 에 넣어두면 된다. 참고로 js와 css도 이러한 방식으로 사용가능하다.
경로가 잡혀있기 때문에 다음과 같이 상대 경로를 추가하면 사용이 가능해진다.
<img src="img/1.jpg" style="width:200px">'Back-End > Spring' 카테고리의 다른 글
| [Spring] CSS 파일 변경 후 적용 안될 때 (0) | 2022.03.24 |
|---|---|
| [SpringBoot][오류] Duplicate entry 'goguma' for key 'member.PRIMARY' (0) | 2022.03.24 |
| [SpringBoot][오류] Springboot에서 jsp를 읽지 못하는 오류 (0) | 2022.03.23 |
| [SpringBoot][오류] To display the conditions report re-run your application with 'debug' enabled (0) | 2022.03.23 |
| [SpringBoot][오류] Invalid bound statement (not found): (0) | 2022.03.23 |