I have a table, following is my code:
<table id="div1" style="display:none">
<tr><td>Host Name</td><td>Directory</td><td>User Name</td><td>Password</td></tr>
<c:if test="${empty location.fEvents}">
<tr><td><form:input path="userEnteredHostNameString" size="30" maxlength="200"/></td>
<td><form:input path="userEnteredDirectoryString" size="30" maxlength="200"/></td>
<td><form:input path="userEnteredUserNameString" size="20" maxlength="20"/></td>
<td><form:input path="userEnteredPasswordString" size="20" maxlength="20"/></td>
</tr>
</c:if>
<c:forEach items="${location.fEvents}" var="item" varStatus="loop">
<tr><td><form:input path="fEvents[${loop.index}].hostName" size="30" maxlength="200"/></td>
<td><form:input path="fEvents[${loop.index}].directory" size="30" maxlength="200"/></td>
<td><form:input path="fEvents[${loop.index}].userName" size="20" maxlength="20"/></td>
<td><form:input path="fEvents[${loop.index}].password" size="20" maxlength="20"/></td></tr>
</c:forEach>
</table>
whatever this ${location.fEvents}
comes to either empty or with values..if User wants...user can add/delete a row and the values of the row should save back in the database..
what is the best way to do it..can we do it in spring
or we need to use javascript
..suggestions are really appreciated
EDITED: How can add validation errors to these fields if they are empty or null(just to the above code without javascript)