Spring中的一个简单的Form
<form method="POST" name="EditOrderItemsForm">
<display:table name="command.orderItems" id="item" defaultsort="1">
<display:column property="article.code" titleKey="Article.Code"/>
<display:column titleKey="OrderItem.Quantity">
<spring:bind path="command.orderItems[${item_rowNum-1}].quantity">
<input type="text" size="7" name="${status.expression}" value="${status.value}" style="text-align:right">
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
<spring:bind path="command.orderItems[${item_rowNum-1}].unit">
<select name="${status.expression}">
<option value="">---</option>
<option value="Pcs" <c:if test="${status.value eq 'Pcs'}">selected="true"</c:if> >Pcs</option>
<option value="Set" <c:if test="${status.value eq 'Set'}">selected="true"</c:if> >Sets</option>
</select>
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.NumberOfCartons">
<spring:bind path="command.orderItems[${item_rowNum-1}].numberOfCartons">
<input type="text" size="6" name="${status.expression}" value="${status.value}" style="text-align:right">Cts
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.UnitPerCarton">
<spring:bind path="command.orderItems[${item_rowNum-1}].unitPerCarton">
<input type="text" size="6" name="${status.expression}" value="${status.value}" style="text-align:right">/Cts
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.Volume">
<spring:bind path="command.orderItems[${item_rowNum-1}].volume">
<input type="text" size="9" name="${status.expression}" value="${status.value}" style="text-align:right">m3
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.Weight">
<spring:bind path="command.orderItems[${item_rowNum-1}].weight">
<input type="text" size="9" name="${status.expression}" value="${status.value}" style="text-align:right">kg
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
</display:table>
<input type="submit" value="<fmt:message key="Action.submit"/>"/>
</form>
<form method="POST" name="EditOrderItemsForm">
<display:table name="command.orderItems" id="item" defaultsort="1">
<display:column property="article.code" titleKey="Article.Code"/>
<display:column titleKey="OrderItem.Quantity">
<spring:bind path="command.orderItems[${item_rowNum-1}].quantity">
<input type="text" size="7" name="${status.expression}" value="${status.value}" style="text-align:right">
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
<spring:bind path="command.orderItems[${item_rowNum-1}].unit">
<select name="${status.expression}">
<option value="">---</option>
<option value="Pcs" <c:if test="${status.value eq 'Pcs'}">selected="true"</c:if> >Pcs</option>
<option value="Set" <c:if test="${status.value eq 'Set'}">selected="true"</c:if> >Sets</option>
</select>
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.NumberOfCartons">
<spring:bind path="command.orderItems[${item_rowNum-1}].numberOfCartons">
<input type="text" size="6" name="${status.expression}" value="${status.value}" style="text-align:right">Cts
<span class="error">< c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.UnitPerCarton">
<spring:bind path="command.orderItems[${item_rowNum-1}].unitPerCarton">
<input type="text" size="6" name="${status.expression}" value="${status.value}" style="text-align:right">/Cts
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.Volume">
<spring:bind path="command.orderItems[${item_rowNum-1}].volume">
<input type="text" size="9" name="${status.expression}" value="${status.value}" style="text-align:right">m3
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
<display:column titleKey="OrderItem.Weight">
<spring:bind path="command.orderItems[${item_rowNum-1}].weight">
<input type="text" size="9" name="${status.expression}" value="${status.value}" style="text-align:right">kg
<span class="error"><c:out value="${status.errorMessage}" /></span>
</spring:bind>
</display:column>
</display:table>
<input type="submit" value="<fmt:message key="Action.submit"/>"/>
</form>