Why does this JSTL expression not seem to be able to use the length method of the String class:
<c:when test="${displayName != null && displayName.length > 0 }">
<p><c:out value="${displayName}"/></p>
</c:when>
It produces this exception:
java.lang.RuntimeException: javax.servlet.ServletException:
javax.servlet.jsp.el.ELException: Unable to find a value for "length" in object
of class "java.lang.String" using operator "."
I have included the following tag libraries at the top of the JSP:
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>