Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "#fields.hasAnyErrors()" (template: "common/form_errors" - line 2, col 19)pw_change.html <form th:action method="post" th:object="${pwChangeForm}" onsubmit="ChangePasswordForm__submit(this); return false;">
<div th:replace="~{common/form_errors :: formErrorsFragment}"></div>
form_errors.html
<div th:fragment="formErrorsFragment" class="alert alert-danger"
role="alert" th:if="${#fields.hasAnyErrors()}">
<div th:each="err : ${#fields.allErrors()}" th:text="${err}"> </div>
</div>

정말 모르겠네..
해결 : 컨트롤러에서 @ModelAttribute를 사용하여 명시해줌
위에 pw_change.html 일부 코드 보면 pwChangeForm로 매핑되라고 object 지정해줬고
컨트롤러에서도 pwChangeForm 이렇게 해줬는데,.. 어이가 없음 이것만 이럼..
기존 Controller
@PreAuthorize("isAuthenticated()")
@GetMapping("/change/passwd")
public String showChangePW(PWChangeForm pwChangeForm) {
return "user/pw_change";
}
@PreAuthorize("isAuthenticated()")
@GetMapping("/change/passwd")
public String showChangePW(@ModelAttribute("pwChangeForm") PWChangeForm pwChangeForm) {
return "user/pw_change";
}
글 잘 봤습니다.