struts2_day06_struts2标签

说明

在JSO页面中,引入struts标签库

<%@ taglib uri="/struts-tags" prefix="s" %>

s:iterator标签

作用

用于遍历集合,在jsp中显示

属性

  • value:取值是一个OGNL表达式

  • var:

    • 写了该属性:var的值是一个字符串,他会把var的值作为key,把当前遍历的对象作为value,存入contextMap中

    • 没写该属性:把当前遍历的对象压栈,每次遍历结束后弹栈

  • begin:遍历的开始索引

  • end:遍历的结束索引

  • step:遍历的步长

  • status:计数器对象

  • isOdd:是否是奇数行

  • isEven:是否是偶数行

  • isFirst:是否是第一行

  • isLast:是否是最后一行

  • getCount:获取当前遍历的个数 从1开始

  • getIndex:获取当前遍历的索引 从0开始

<s:iterator value="list" var="customer">
	<TR style="FONT-WEIGHT: normal; FONT-STYLE: normal; BACKGROUND-COLOR: white; TEXT-DECORATION: none">
		<TD><s:property value="#customer.custName"/></TD>
		<TD><s:property value="#customer.custLevel"/></TD>
		<TD><s:property value="#customer.custSource"/></TD>
		<TD><s:property value="#customer.custIndustry"/></TD>
		<TD><s:property value="#customer.custAddress"/></TD>
		<TD><s:property value="#customer.custPhone"/></TD>
		<TD>
		<a href="${pageContext.request.contextPath }/selectCustomerByCid_Customer.action?custId=${customer.custId}">修改</a>
			&nbsp;&nbsp;
		<a href="${pageContext.request.contextPath }/customer/CustomerServlet?method=removeCustomer&custId=${customer.custId}">删除</a>
		</TD>
	</TR>
</s:iterator>

s:actionerror

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值