IntelliJ IDE에서 Spring boot + Thymeleaf 사용 도중 템플릿에서 에러가 발생했다.
오류 메시지
Cannot resolve variables
Validates unresolved references and invalid expressions thymeleaf
해결하기 위해 시도했던 삽질들...
1. html 태그의 xmlns:th 속성에서 www.를 제거하기
변경 전
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
변경 후
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://thymeleaf.org">
오류는 사라졌으나 맘에 들지 않는다.
2. Maven Reload Project(Update Project)
안된다.
3. Projcet > Add Framework Support > Thymeleaf 체크하기
이것 또한 안된다...
해결
Preference > Editor > Inspections > Thymeleaf > Expression variables validation 을 해제한다.
프로젝트에서 비정상적인 코드를 감지하는 기능을 끄면 된다.
오류가 사라졌음을 확인 할 수 있다.
당장 오류를 숨기는 것은 성공했지만 과연 올바른 해결인가 고민해 볼 필요가 있다.
Reference
Thymeleaf
www.jetbrains.com/help/idea/thymeleaf.html
Thymeleaf | IntelliJ IDEA
www.jetbrains.com
Spring Boot autoconfigured webapp: resolve model variables
youtrack.jetbrains.com/issue/IDEA-132738
Spring Boot autoconfigured webapp: resolve model variables : IDEA-132738
I have a simple project. I'm using spring-boot-starter-web (including spring mvc) and spring-boot-starter-thymeleaf. I'm using pure java configuration to configure spring. Now i have a simple hello.html and SampleController.java. If i start the application
youtrack.jetbrains.com
Spring boot + thymeleaf in IntelliJ: cannot resolve vars
stackoverflow.com/questions/38710585/spring-boot-thymeleaf-in-intellij-cannot-resolve-vars
Spring boot + thymeleaf in IntelliJ: cannot resolve vars
I'm writing a short web form application using spring boot and thymeleaf on IntelliJ, but it seems that in the html file, all fields in the model cannot be resolved. Here is my code: Controller cl...
stackoverflow.com
'Tool' 카테고리의 다른 글
[Notion] 노션에서 D-Day 디데이 속성 사용하기 (0) | 2021.04.18 |
---|---|
IntelliJ Project 경로 숨기기 (0) | 2021.04.03 |