jstl find the length of list

<%@ taglib prefix="c" uri=" http://java.sun.com/jsp/jstl/core"%
<%@ taglib uri=" http://java.sun.com/jsp/jstl /functions " prefix="fn"%>--------the standard.jar package is required here

Two packages that must be imported.

 

The jsp page can use the fn tag to judge whether the list passed by the action is empty or the length of the list.size:

<c:if test="${list== null || fn:length(list) == 0}"></c:if>This can be judged.

 

I use it like this:

<!-- Only when the result set is greater than 0 can be modified in batches-->
<c:if test="${(pageHelper.list)!= null && fn:length(pageHelper.list) > 0}">

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325767615&siteId=291194637