Use of the struts2 if tag has used iteration to retrieve the attributes of the object in the list.

Source: Internet
Author: User

<S: iterator id = "ulist" value = "ulist" status = "A"> <! -- Add a sequence number to the iterative list ulist and store it in variable A -->
<S: If test = "# A. Odd"> <! -- # A. Odd determines whether a is an odd number -->

<Tr> <! -- Odd number of rows -->
<TD> <s: property value = "# ulist [0]"/> </TD> <! -- The ulist object is stored here. # ulist [0] is used to retrieve the first object. -->
<TD> <s: property value = "# ulist [1]"/> </TD>
<TD> <s: property value = "# ulist [2]"/> </TD>
<TD> <s: If test = "# ulist [3] = 1"> member </S: If> <s: else> volunteer </s: else> </TD> <! -- If else can understand this. -->
<TD> <s: If test = "# ulist [3]! = 1 "> no fee deduction </S: If> <s: else> <s: if test = "# ulist [4] = 0"> <font color = 'red'> fee not deducted </font> </S: If> <s: else> fee deducted </S: else> </TD>
<TD> <input type = "button" value = "edit"> <input type = "button" value = "delete" onclick = "javascript: delect (<s: property value = "# ulist [0]"/>) "> </TD>
</Tr>
</S: If>
<S: else>
<Tr class = "altrow"> <! -- Even number of rows -->
<TD> <s: property value = "# ulist [0]"/> </TD>
<TD> <s: property value = "# ulist [1]"/> </TD>
<TD> <s: property value = "# ulist [2]"/> </TD>
<TD> <s: If test = "# ulist [3] = 1"> member </S: If> <s: else> volunteer </s: else> </TD>
<TD> <s: If test = "# ulist [4] = 0"> <font color = 'red'> fee not deducted </font> </s: if> <s: else> fees have been deducted </S: else> </TD>
<TD> <input type = "button" value = "edit"> <input type = "button" value = "delete" onclick = "javascript: delect (<s: property value = "# ulist [0]"/>) "> </TD>
</Tr>

</S: else>
</S: iterator>
Use of the struts2 if tag has used iteration to retrieve the attributes of the object in the list.

 

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.