Summary of common parameters of varstatus properties

Source: Internet
Author: User

We often use the C tag to traverse the required data (for example: <c:foreach items= "${itemlist}" var= "Item" varstatus= "status" >) for easy use,varstatus attributes allow us to implement some of the 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 current iteration (in the collection) item
${status.first}  Determines whether the current item is the first item in the collection and returns True or False
${ Status.last}   Determines whether the current item is the last item in the collection, the return value is TRUE or false
begin, end, and step are represented by the starting sequence number, the ending sequence number, the jump pace.

For example:

<c:foreach items= ' ${list} ' var= ' item ' begin= ' 1 ' end= ' step= ' 2 ' >

: List: Traversal of the set, item: Each subkey of the set, starting with subscript 1, 10 ending, each 2 subscript to traverse, is the 1,3,5,7,9 subscript is taken out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.