struts2 标签总结

文本域: <s:textfield name="womenName"  id="womenNameId" cssClass="max-length-10"/>

下拉框: <s:select list="marriedStations" listKey="CODE" listValue="NAME" name="marriedState" id="marriedStateId" headerKey="" headerValue="请选择"></s:select>

list对应集合 listKey代表传入后台的值  listValue显示内容

下拉框(带固定值) 

<s:select list="#{'':'请选择','1':'第一季度','2':'第二季度','3':'第三季度','4':'第四季度'}" cssClass="required" name="quarter" οnchange="selectCheckType(this.value)" id="quarterId" ></s:select>

隐藏域

<s:hidden name="checkNum" value="%{c03Vo.checkNum}"></s:hidden>

%{c03Vo.checkNum}给隐藏赋值 c03Vo代表action中成员变量 checkNum 代表成员变量属性

<s:hidden name="yearly"></s:hidden>隐藏域做页面返回用

if语句标签

<s:if test="pIS_RESULTHEALTH.PISFIELD501==1">
       <input type="radio" name="pIS_RESULTHEALTH.PISFIELD501" value="1" checked >

 </s:if>
  <s:else>
         <input type="radio" name="pIS_RESULTHEALTH.PISFIELD501" value="1" >
  </s:else>

test 代表判断真假 pIS_RESULTHEALTH代表action成员对象 PISFIELD501代表成员对象属性

url标签

<s:url id="url_pre"
   value="ServiceQueryActiongetLiveServiceListResult">
   <s:param name="pageNow" value="pageNow-1"></s:param>
   <s:param name="dateFrom" value="dateFrom"></s:param>
   <s:param name="dateEnd" value="dateEnd"></s:param>
   <s:param name="counselTitle" value="counselTitle"></s:param>
  </s:url>

<s:a  href="%{url_pre}" >上一页</s:a>

param 代表参数名和值

ServiceQueryActiongetLiveServiceListResult代表访问的action和方法getLiveServiceListResult

struts标签取值标签

<s:property value="pIS_RESULTHEALTH.PISFIELD_FAMILYNUM"/>pIS_RESULTHEALTH代表成员对象 .PISFIELD_FAMILYNUM代表成员对象属性

iterator标签

<s:iterator value="bookList" status="status" id="a">
     <s:if test="#status.index==0">
     </s:if><s:else>
     <tr id="prize${status.index}">
         <th width="8%" height="40" nowrap>宣传品种类:</th>
         <td width="20%" height="40" align="left" nowrap class="tr_s">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td>
                <s:select id="selectResType%{#status.index}" list="teachResType" headerKey="" headerValue="--请选择--" listKey="CODE" listValue="NAME"

                 name="bookList[%{#status.index}].PISFIELD_TEACHRESTYPE" cssClass="select1"  />
               </td>
             </tr>
         </table>
         </td>
         <th width="8%" height="40" nowrap>宣传品书目种类:</th>
         <td height="40" align="left" nowrap class="tr_s">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
           <tr>
             <td width="30%">
              <s:select id="selectBook%{#status.index}"  list="books" headerKey="" headerValue="--请选择--" listKey="CODE" listValue="NAME"

            name="bookList[%{#status.index}].PISFIELD_TEACHBOOKNAME" cssClass="select1"  />
             </td>
             <td width="88%">
     <input name='delete2' type='reset' class='btn_mouseout' value='删 除' οnclick="DeleteSignRow('prize${status.index}')"/>
             </td>
           </tr>
         </table>
         </td>
       </tr>
     </s:else>
     </s:iterator>

bookList代表list集合 定义在action成员变量 status代表状态 status.index代表索引 selectBook%{#status.index} 代表id 如selectBook0 %{#status.index} 代表数字

bookList[%{#status.index}].PISFIELD_TEACHBOOKNAME代表集合中对象属性

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值