How to use C tags

Source: Internet
Author: User

1. C:foreach

<c:foreach items="${map.value}"var="obj" varstatus="varstatus" begin="0" end=" 4 ">

Note that Varstatus is equivalent to a for loop counter, starting with 1, with ${varstatus.count} to get the value of the counter. The begin is counted from the user's own defined number. This loops the map so that you can use ${obj.key} to get the map's Kay,${obj.value} to get the value of the map.

Sometimes we just need to do the processing at the first loop, there are two ways:

1.1 Using Varstatus count is a trickle of several loops

1.2 Use inside the loop

<c:iftest="${zbzpd==null}"> <p>do something</p></c:if><c:iftest="${zbzpd==null}"> <c:Set var="ZBZPD"Value="1"Scope="page"&GT;&LT;/C:Set>

Here is the definition of a variable ZBZPD, which can then be obtained by means of an El expression. value is the corresponding values. Scope is the scope that can make page,session and so on.

How to use C tags

Related Article

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: 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.