본문 바로가기
개발일지/일간회고 (TIL)

Thymeleaf TemplateInputException 에러 해결

by 윤승임 2022. 12. 11.

Post API인 요놈을 POSTMAN에서 테스트해보았다.

아 근데 POSTMAN 자바스크립트 없어도 되더라.. 나는 그것도 모르고 어제 하루종일 머리 쥐어뜯으면서 빨빨댔다.. 흑흑

이런 식으로 JSON 형식의 값을 넣고, 테스트를 해보았다.
그런데 에러코드 500이 뜨면서 제대로 실행이 되지 않았다.

인텔리제이에서 자세히 확인해보니 Thymeleaf TemplateInputException 라는 에러 메세지가 나왔다.

그래서 검색한 결과

@Controller라고 선언했던 어노테이션을 @RestController로 바꾸어주니까 제대로 실행이 되었다!!

 

근데 왜 작성시간이 안나오지..??

 

오류 메세지
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [api/newPost], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause