<%@ 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>
时间: 2024-12-17 14:11:59