I am looking to find out the difference between the spring:bind and form:form tag libraries when submitting a form.
A snippet of my JSP is as follows:
<form:form modelAttribute="testRulesForm">
....
<td>
<form:checkbox path="rules[${counter.index}].isActive" value="rules[${counter.index}].isActive"/>
</td>
<td>
<form:select path="rules[${counter.index}].leftCondition.name">
<form:options items="${testRulesForm.ruleAttributes}" itemLabel="name" itemValue="name" />
</form:select>
</td>
<td>
<form:select path="rules[${counter.index}].operator">
<form:options itemLabel="operator" itemValue="operator" />
</form:select>
</td>
....
Seeing as I have my path variable specified and this will be bound to my modelAttribute, does this mean that I do not need spring:bind?
Thanks
Normally you don’t need to use
<spring:bind>if you already useformtaglib.They do basically the same with respect to model attributes, but tags from
formtaglib also generate HTML form markup, whereas with<spring:bind>you need to generate markup yourself.The following code with
formtags:is similar to the following code with
<spring:bind>:<spring:bind>is useful when you need something customized, that cannot be achieved byformtaglib.