jstl_fn方法库

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

1,startsWith,endsWith

    <c:if test="${fn:endsWith(param.aa, 'end') }">
        ends
    </c:if>
    <c:if test="${fn:startsWith(param.aa, 'start') }">
        start
    </c:if>

2,indexOf

    <c:set var="test" value="${param.aa }" scope="application"/>
    <c:if test="${ fn:indexOf(test,'hello') != -1 }">
        hello
        </c:if>

3split

    <c:set value="${fn:split(header,',') }" var="headerList"/>
    <c:forEach var="item" items="${headerList }">
        ${item }<br/>
        </c:forEach>

原文地址:https://www.cnblogs.com/vhyc/p/6596805.html