1。<html:radio>标签如何能让其中的一个radio是初始时候就是选中的
<html:radio property="radioVar" value="Value1"/>
<html:radio property="radioVar" value="Value1"/>
加上一个name 属性就可以了.
<html:radio property="radioVar" name='XXXX' value="Value1"/>
然后在显示之前给 name 设置值
2。form与循环
今天发现,要用循环实现多个form(可修改的)列表,<form>标签一定要在循环内:例如
for (int i = 0; i < ar.size(); i++) {
customer = (CustomerEditForm) ar.get(i);
cuId = customer.getCu_id();
cuCode = customer.getCu_code();
cuName = customer.getCu_name();
cuPassword = customer.getCu_password();
cuPhone = customer.getCu_phone();
session.setAttribute("cu_id", Integer.toString(cuId));
%>
<!-- info(edit) form start-->
<html:form action="/customerEdit">
<jsp:setProperty name="customerBean" property="cu_id"
value="<%=cuId%>" />
<jsp:setProperty name="customerBean" property="cu_name"
value="<%=cuName%>" />
<jsp:setProperty name="customerBean" property="cu_old_name"
value="<%=cuName%>" />
<jsp:setProperty name="customerBean" property="cu_password"
value="<%=cuPassword%>" />
<jsp:setProperty name="customerBean" property="cu_phone"
value="<%=cuPhone%>" />
<tr><td><%=cuCode%></td>
<html:hidden name="customerBean" property="cu_id" />
<!-- 用户名可改否?此处设置为不可改 -->
<td><%=cuName %>
<html:hidden name="customerBean" property="cu_name" />
<html:hidden
name="customerBean" property="cu_old_name" /><!-- for name check in DriverEditAcion --></td>
<td><html:text property="cu_password" name="customerBean" /></td>
<td><html:text property="cu_passwordconfirm" name="customerBean" /></td>
<td><html:text property="cu_phone" name="customerBean" /></td>
<td><html:submit property="editAction">
<bean:message key="manage.user.customer.edit" />
</html:submit></td>
<td><html:submit property="editAction">
<bean:message key="manage.user.customer.delete" />
</html:submit></td>
</tr>
</html:form>
<!--form end -->
<%}%>
3.http://www.matrix.org.cn/thread.shtml?topicId=3062&forumId=22 循环中的form取值的探讨
private String[] quantity;
public String[] getQuantity() {return quantity;}
public void setQuantity(String[] quantity) { this.quantity = quantity; }
待验证