예전 프로젝트는 jsp파일에 include 를 하여 레이아웃을 적용시켰지만 스프링부트 + thymeleaf 을 사용하면 tomcat을 별도로 설치 할 필요도 없고 jar로 빌드 시킬 수 있기때문에 이번 프로젝트는 jsp파일이 아닌 thymeleaf 를 사용하기위해 수정하였다
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
spring.thymeleaf.enabled=true
spring.thymeleaf.cache=false
spring.thymeleaf.check-template-location=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
<html lang="en"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<html lang="en"
xmlns:th="http://www.thymeleaf.org"
th:fragment="SideContent">
<th:block th:replace="/layout/sideContent :: SideContent"></th:block> //기존
<th:block th:replace="/layout/sideContent :: SideContent"></th:block> //수정
인텔리제이에서 실행 할 때는 정상적으로 실행이 됐지만 터미널을 통해 빌드했을 때 오류가 나왔다 검색해보니 경로의 문제여서 경로를 수정하니 제대로 실행이 되었다 휴!ㅜ
참고 : https://adjh54.tistory.com/75