You used the form at the top of your html page:
<form method="post" th:object="${entSetCharges}" th:action="@{/updatesetcharges}">
The th:field="*{chargesName}
is bound to the object/bean inside your th:object="${entSetCharges}
. Meaning that you are searching for a chargesName
field inside your entSetCharges
object which does not exist or is null.
Solution:
Maybe change your th:field="*{chargesName}"
to ${savedcharges.chargesName}
expression to access your object's field.
Try adding respondResult.addObject("entSetCharges",new EntSetCharges());
above your return line. Your view doesn't automatically create this object for you.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…