length( java.lang.Object) - Returns the number of items in a collection, or the number of characters in a string.
put this at the top of the page to allow the fn namespace:
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
and use like this in your jsp page:
<p>The length of the companies collection is : ${fn:length(companies)}</p>
So to test with length of a collection:
<c:if test="${fn:length(companies) gt 0}">
<p>It is greater than 0</p>
</c:if>
Note the use of
gt
instead of >
as >
is not allowed inside jsp/jsf tags.
No comments:
Post a Comment