The "JSP el" El expression gets the list length/no loop, and EL takes the contents of the first item directly in the list/el gets the map key, the value of the map

Source: Internet
Author: User

1.EL expression Get list length

<%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>
<%@ taglib prefix= "FN" uri= "Http://java.sun.com/jsp/jstl/functions"%>

<c:if test= "${fn:length (list name) >1}" >

What do you do in the middle?

</c:if>

2. No loop, El gets the contents of the first item directly in the list

${list[0]. Properties}

3.EL gets the key of the map, the value of the map

<c:foreach items= "${map name}" var= "K" >
<option value= "${k.key}" >${k.value}</option>
</c:forEach>

This gets the keys and values separately.

The "JSP el" El expression gets the list length/no loop, and EL takes the contents of the first item directly in the list/el gets the map key, the value of the map

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.