我有一个jsp模板文件,其格式如下:
<form:form action="addLoan" method="post" modelAttribute="loan" >
<table>
<tr>
<td>Employee ID</td>
<td><form:input path="employeeID"/></td>
</tr>
<tr>
<td>Asset ID</td>
<td><form:input path="assetID"/></td>
</tr>
<tr>
<td>Start Date</td>
<td><form:input path="startDate"/></td>
</tr>
<tr>
<td>End Date</td>
<td><form:input path="endDate"/></td>
</tr>
<tr>
<td></td>
<td><form:button>Submit</form:button></td>
</tr>
</table>
</form:form>
我想知道如何使最终条目(endDate)为可选,以便在提交时将其保留为空白。目前,如果我将其保留为空白,则会收到Validation failed for object='loan'. Error count: 1
错误。