How to obtain the struts2 Tag Length

Source: Internet
Author: User
<S: iterator value = "% {entitylist}" id = 'vo' status = 'st'> <tr <s: If test = "# St. even "> class =" sprittr "</S: If >>< S: If test =" # St. first "> <TD align =" center "rowspan =" <s: property value = "entitylist. size () "/>"> <s: property value = "1"/> </TD> </S: If></Tr> </S: iterator>

Here we mainly want to get the length of entitylist from the beginning, so we solved it with <s: property value = "entitylist. Size ()"/> ~

<S: iterator> </S: iterator> some attributes:

How to use status in <s: iterator>
1: # status. Odd whether the current element index has an odd number of rows
2: # status. Even whether the index of the current element is even
Line
3: # status. Count: several elements are iterated currently.
4: # status. Index current element index, starting from 0 "# status. Count = # status. index + 1 』
5: # status. First: whether the current is the first element
6: # status. Last whether the current element is the last one
7: # status. Modules (INT) current number of rows modulo

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.