页面上提交List对象

              页面上提交List对象

                                                         QueryCondition 
  1. public class QueryCondition {
  2.     
  3.     private String name;
  4.     
  5.     private String alias;
  6.     
  7.     private int type;
  8.     
  9.     private String stringValue;
  10.     
  11.     private String[] values;
  12.     
  13.     private boolean isValues = false;
  14.     
  15.     private boolean isConstraint = false;
  16.     
  17.     private Constraint constraint;
  18.          .......(get set 方法省略)
  19. }
在页面上迭代List<QueryCondition> conditionList
                                                                                       JSP页面
  1. <s:iterator value="conditionList" status="st" >
  2. <tr>
  3.   <s:hidden name="conditionList[%{#st.index}].name" value="%{name}"/>
  4.   <s:hidden name="conditionList[%{#st.index}].alias" value="%{alias}"/>
  5.   <s:hidden name="conditionList[%{#st.index}].type" value="%{type}"/>
  6.   <s:hidden name="conditionList[%{#st.index}].isValues" value="%{isValues}"/>
  7.   <s:hidden name="conditionList[%{#st.index}].isConstraint" value="%{isConstraint}"/>
  8. <td  height="25" align="right" class="STYLE2"><s:property value="alias"/>:</td>
  9. <td  class="leftpadding">
  10.   <s:if test="type==0"><input  type="text" name="conditionList[${st.index}].stringValue"  value=""/></s:if>
  11.   <s:elseif test="type==1"><input type="text" name="conditionList[${st.index}].stringValue" value="" /></s:elseif>
  12.   <s:elseif test="type==2">
  13.     <s:if test="isConstraint">
  14.       <s:if test="isValues">
  15.           <s:checkboxlist name="conditionList[%{#st.index}].values" list="constraint.readMultipleValues()" theme="simple" value=""/>
  16.       </s:if>
  17.       <s:else>
  18.           <s:select name="conditionList[%{#st.index}].stringValue1" list="constraint.readMultipleValues()"  theme="simple" emptyOption="true" value=""/>
  19.       </s:else>
  20.       </s:if>
  21.       <s:else>
  22.           <input type="text" name="conditionList[${st.index}].stringValue1"  value=""/>
  23.       </s:else>
  24.   </s:elseif>
  25.   <s:elseif test="type==4"><input type="text" name="conditionList[${st.index}].stringValue" value="" /></s:elseif>
  26.   <s:elseif test="type==3">
  27.      <s:radio name="conditionList[#st.index].stringValue" list="#{'true':'true','false':'false'}" theme="simple" value=""/>
  28.   </s:elseif>
  29. </td></tr>
  30. </s:iterator>
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值