需求,对带有相同符合格式内容进行分割输出,例如,varstr="1,2,3,4,5,6";
c:forTokens属性说明表
引用
varStatus,它们描述了迭代的当前状态,如下这些属性的含义如下所示:
current:当前这次迭代的(集合中的)项。
index:当前这次迭代从0开始的迭代索引。
count:当前这次迭代从1开始的迭代计数。
first:用来表明当前这轮迭代是否为第一次迭代,该属性为boolean类型。
last:用来表明当前这轮迭代是否为最后一次迭代,该属性为boolean类型。
begin:begin属性的值。
end:end属性的值
step:step属性的值
<c:forTokens var="str" items="${sourceStr}" delims="|," varStatus="status">
<c:out value="${status.count}" />//当前这次迭代从1开始的迭代计数
<c:out value="${status.index}" />//当前这次迭代从0开始的迭代索引
<c:if test="${status.last}">//用来表明当前这轮迭代是否为最后一次迭代
<br>总共被分为<c:out value="${status.count}" />段.
</c:if>
<c:out value="${status.index}" />//当前这次迭代从0开始的迭代索引
</c:forTokens>
- 大小: 8.9 KB
分享到:
相关推荐
◎ JSTL的基本概念、安装与配置 ◎ JSTL的通用标记:<c:out>、<c:set>、<c:remove>和<c:catch>标记 ◎ 条件处理标记:<c:if>、<c:choose>、<c:when>和<c:otherwise>标记...◎ 循环标记:<c:forEach>和<c:forTokens>标记
用于循环的 <c:forEach>?标签 用于分隔字符的 <c:forTokens>?标签? 用于包含页面的 <c:import> 用于得到 URL?地址的 <c:url>?标签? 用于页面重定向的 <c:redirect>?标签? 用于包含传递参数的?<c:param> 标签?.
1.关键字:JSTL标签、<c:choose>、<c:forEach>、<c:forTokens>、<c:if>、<c:import>、<c:otherwise>、<c:out>、<c:param>、<c:redirect>、<c:remove>、<c:url>、<c:when>、<c:set>、<c:catch>
JSTL标签总结-<c:if>,<c:choose>,<c:forEach>,<c:forTokens>,<c:catch>,<c:remove >,<c:set>,<c:import>,<c:redirect>,<c:url>,<fmt>
JSTL 以及自定义标签...3.循环标签:forEach、forTokens 4.URL操作标签:import、url、redirect 使用标签时,一定要在jsp文件头加入以下代码: <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<td><c:out value="${user.relatedGroup.name}"/></td><br> </tr><br> </c:forEach> </table><br> <p><br> 循环控制标签:c:fortoken</li><br> <c:forTokens items="${tokenstr}" delims="," var="v"> <c...
EL表达式 (详解) EL表达式 ... 4) 条件标签> 1.算术运算符有五个:+、-、*或$、/或div、%或mod 2.关系运算符有六个:==或eq、!=或ne、<或lt、>或gt、或le、>=或ge 3.逻辑运算符有三个:&&或and、||或or、!或not ...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、读取资源...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、读取资源...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、读取资源...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、读取资源...
13.3.8、<c:forTokens>标签 13.3.9、<c:import>标签 13.3.10、<c:url>标签 13.3.11、<c:redirect>标签 13.4、国际化标签库 13.4.1、<fmt:setLocale>标签 13.4.2、<fmt:requestEncoding>标签 13.4.3、...
1.表达式控制标签:out、set、remove、catch 2.流程控制标签:if、choose、when、otherwise 3.循环标签:forEach、forTokens 4.URL操作标签:import、url、redirec
c:forEach and c:forTokens Tags Section 9.4. c:if Tag Section 9.5. c:choose Tag Section 9.6. c:set and c:remove Tags Section 9.7. c:import Tag Section 9.8. c:url and c:param Tags Section 9.9. c:...
c:forEach and c:forTokens Tags Section 9.4. c:if Tag Section 9.5. c:choose Tag Section 9.6. c:set and c:remove Tags Section 9.7. c:import Tag Section 9.8. c:url and c:param Tags Section 9.9. c:...
1.EL简介 2.EL隐含对象 3.其他隐含对象 4.条件标签 5.迭代标签ForEach 6.分割循环标签ForTokens 7.格式化标签FMT 8.常用逻辑运算符
04_Java标签库 使用来: 演示如何使用普通 Java JSP Scriptlet <% ...... & JSP 表达式<%= ...... 测试条件( if和choose )、迭代( forEach和forTokens )和<c>标签 使用测试<c>标签