c:forTokens Action Tag

This section describes the c:forTokens action tag in the JSTL Core library. c:forTokens allows you to specify a section of JSP code that will be processed repeatedly by iterating through a list of tokens.

The <c:forTokens> action tag allows you to specify a section of JSP code that will be processed repeatedly by iterating through a list of tokens. Syntax of the <c:forTokens> action tag is:

<c:forTokens var="name" items="token_list" delims="expression" 
   begin="expression" end="expression" step="expression">
   body
</c:forTokens>

Note that:

In other words, the string specified by the "items" attribute will be tokenized with the delimiter specified by the "delims" attribute. Then resulting tokens will be iterated. At each iteration, the current token will assign to a named variable specified in the "var" attribute, and body will be processed.

If the "begin", "end" or "step" attribute is specified, it will be used to restrict the beginning element, the ending element, or the step size of the iteration.

Last update: 2012.

Table of Contents

 About This Book

 JSP (JavaServer Pages) Overview

 Tomcat 7 Installation on Windows Systems

 JSP Scripting Elements

 Java Servlet Introduction

 JSP Implicit Objects

 Syntax of JSP Pages and JSP Documents

 JSP Application Session

 Managing Cookies in JSP Pages

 JavaBean Objects and "useBean" Action Elements

 Managing HTTP Response Header Lines

 Non-ASCII Characters Support in JSP Pages

 Performance of JSP Pages

 EL (Expression Language)

 Overview of JSTL (JSP Standard Tag Libraries)

JSTL Core Library

 What Is JSTL Core Library?

 c:out Action Tag

 c:out Action Tag with EL Expressions

 c:set Action Tag

 c:if Action Tag

 c:choose Action Tag

 c:forEach Action Tag

c:forTokens Action Tag

 Example - Dumping EL Implicit Objects

 Example - Calculating Prime Numbers

 JSP Custom Tags

 JSP Java Tag Interface

 Custom Tag Attributes

 Multiple Tags Working Together

 File Upload Test Application

 Outdated Tutorials

 References

 PDF Printing Version