org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "user.name" (template: "user/joinForm" - line 179, col 54)
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'name' cannot be found on null
에러문구
🍟 해결
<div class="label">
<lable for="username">Name</lable>
<input type="text" id="username" name="name" th:value="${userDto?.name}" class="form-control" placeholder="이름" requred autofocus>
</div>
"${userDto.name}"을 "${userDto?.name}"로 수정하고 해결했다.
?은 null이 발생할 수 있는 프로퍼티에 넣는다.
?은 if를 의미한다.
해결 x
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
첫 번째 코드를 두 번째 코드로 바꾸고 해결했다는 사람도 있던데..
나는 안 된다.
👇 참고
org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'name' cannot be found on null
Thymeleaf에서 다음과 같은 예외에 직면할 수 있다. org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'name' cannot be found on null 문제가 된 코드는 다음..
devday.tistory.com
https://okky.kr/article/506527
OKKY | intellij + spring boot + Thymeleaf + lombok 사용 시 evaluating SpringEL expression 에러 발생 ㅠ.ㅠ
안녕하세요;;; 인텔리 J 에서 Spring boot 프로젝트를 생성해서 인덱스 페이지를 띄운 상태인데, 컨트롤러에서 Model 객체로 데이터를 담아 index.html 페이지로 값을 넘기려는데 자꾸 th 태그의 값에 오
okky.kr
반응형
'FE > html' 카테고리의 다른 글
form onsubmit (0) | 2022.01.20 |
---|---|
회원가입 정규표현식 (0) | 2022.01.13 |
[CSS] pagination과 버튼 나란히 두기 (0) | 2021.12.02 |
[ERROR] org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "#temporals.createDate(post.createdDate, 'yyyyMMdd')" (0) | 2021.11.26 |
form을 submit하는 3가지 태그(button, a, input) (0) | 2021.11.24 |