Fortokens Label
The role of this tag is very similar to the StringTokenizer class in Java, which uses the Items property to specify a specific string, and then assigns a delimiter through the Delims property (which can be specified at the same time) by specifying the delimiter to put items property to group the specified string. Like the ForEach tag, the fortokens tag can also specify begin and end and step property values.
This label is used in the following format:
<c:fortokens items= "Stringoftokens" delims= "delimiters" var= "varName" [varstatus= "Varstatusname"]
[begin= "Begin"] [end= "End"] [step= "Step"]>
Body Content
</c:forTokens>
The individual attributes in the tag are described below:
var: the name of the parameter to iterate over.
Items: The specified string to label.
Varsatus: status information for each iteration.
Delims: Uses the delimiter specified by this property to split the string specified by the items.
Begin: The position at which the iteration begins.
End: The position at which the iteration ends.
Step: The step size of the iteration.
Although ForEach can also iterate tokenstring, for example, the following code:
<c:foreach var= "value" items= "NUM1,NUM2,NUM3" >
<c:out value= "${value}"/>
</c:forEach>
But the fortokens tag is more powerful when it comes to handling tokenstring.
Jsp:jstl label Fortokens