首页 > 技术文章 > el: 在jsp页面内使用函数判断子字符串

ChewApple 2016-01-11 11:25 原文

e.g.

 

<c:forEach items="${datas}" var="data">
    <c:if test="${not fn:containsIgnoreCase(data, 'apple')}">
        <p>Doesn't contain 'apple'</p>
    </c:if>
</c:forEach>

 

使用el标签,在jsp页面需要声明:

 

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

  

推荐阅读