Varstatus is an attribute of the <C:FOREACH>JSTL cyclic label, taking varstatus= "status", in effect defining an object named status as the binding value of the varstatus. The binding value, which is the status encapsulates the current traversal state, for example, can be viewed from the object by traversing to the first few elements: ${status.count}. We often use the C tag to traverse the required data, the Varstatus property can implement some functions related to the number of rows, such as: odd rows, even row differences, the last line of special processing, and so on.
Varstatus properties commonly used in the summary of parameters:
${status.index}: Output line number, starting from 0.
${status.count}: Output line number, starting from 1.
${status.current}: The item in the current iteration (in the collection).
${status.first}: Determines whether the current item is the first item in the collection, and the return value is true or false.
${status.last}: Determines whether the current item is the last item in the collection, and the return value is true or false.
Begin, end and step are respectively: Starting serial number, ending serial number, jumping pace. Such as:
<c:foreach begin= ' 1 ' end= ' 5 ' step= ' 2 ' items= ' ${list} ' var= ' item ' >
The 1~5 data in the list collection is not a one-by-one loop, but a value per 2. The 1th, 3, and 5 data in the operation set.