When I use create action is make me a problem for update action th:value=*{name} How to set th:field values to not conflict each other.
Here is the error:
There was an unexpected error (type=Internal Server Error, status=500). Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "designations" - line 243, col 18)
Here is html
<div class="modal-body">
<form th:action="@{/designations/create}" th:object="${newDesignation}" th:method="post">
<div class="form-group">
<label>Designation Name <span class="text-danger">*</span></label>
<input th:field="*{name}" class="form-control" type="text">
</div>
<div class="form-group">
<label>Department <span class="text-danger">*</span></label>
<select th:field="*{departmentName}" class="select">
<option th:each="i : ${departmentsList}" th:value="${i.name}" ></option>
</select>
</div>
<div class="submit-section">
<button class="btn btn-primary submit-btn">Submit</button>
</div>
</form>
</div>
<div class="modal-body">
<form th:action="@{/designations/update/{id}(id=${i.id})}" th:object="${designationToUpdate}" th:method="post">
<div class="form-group">
<label>Designation Name <span class="text-danger">*</span></label>
<input th:field="*{name}" class="form-control" type="text">
</div>
<div class="form-group">
<label>Department <span class="text-danger">*</span></label>
<select th:field="*{departmentName}" class="select">
<option th:each="i : ${departmentsList}" th:value="${i.name}" th:text="${i.name}"></option>
</select>
</div>
<div class="submit-section">
<button class="btn btn-primary submit-btn">Save</button>
</div>
</form>
</div>
