이유는 정확히 모르겠지만 th:field 를 사용하는 대신에 name을 사용해야 한다.
하지만 name 값이 단순 필드가 아니라 아래처럼 list의 필트인 경우 value가 null 넘어오는 현상이 있다.
<input type="hidden" th:name="*{itemOptionGroupList[0].ordering}" value="1">
참고 : https://stackoverflow.com/questions/31542032/how-to-add-default-values-to-input-fields-in-thymeleaf
How to add default values to input fields in Thymeleaf
I am programming in Spring and using Thymeleaf as my view, and am trying to create a form where users can update their profile. I have a profile page which lists the user's information (first name,...
stackoverflow.com
'Java && Spring' 카테고리의 다른 글
[Thymeleaf] nested list에서 input의 th:field 와 th:value 이슈 (0) | 2022.06.27 |
---|---|
spring NoSuchMethodException 에러 (0) | 2022.06.22 |
Neither BindingResult nor plain target object for bean name 'partner' available as request attribute (0) | 2022.06.14 |
The authentication type 10 is not supported (0) | 2021.11.24 |
@Transactional 사용시 주의해야할 점 (0) | 2021.10.02 |