dxy1999
发贴: 32
积分: 20
|
于 2003-08-04 20:37
最近在作Struts的项目,现把我总结的几个技术问题的实现方法总结一下。 1.radio数组的实现 Action:
ArrayList list = new ArrayList();
list.add(0, new LabelValueBean("China", "000")); list.add(0, new LabelValueBean("Japan", "001"));
instance.setChoSelectOutput(list);
request.setAttribute("response", instance);
FormAction: private String label;
/** * @return */ public String getLabel() { return label; }
/** * @param string */ public void setLabel(String string) { label = string; }
JSP: <logic:iterate id = "NewchoSelect" name = "response" property = "choSelectOutput" indexId = "j">
<td> <bean:define name="NewchoSelect" property="label" id="defineFoodName" type="String"/> <html:radio property="label" value='<%=defineFoodName%>'> <bean:write name="NewchoSelect" property="label"/> </html:radio> </td>
</logic:iterate>
dxy1999 edited on 2003-08-05 09:06
|