tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barnett, Brian W." <>
Subject calling a method in c:if tag
Date Thu, 27 May 2004 23:04:09 GMT
I have a List object as a request scoped variable and I want to call a
method on it as the test of a c:if statement. Is this a "no no"? All the
examples I see for c:if use bean objects in the test.  I've tried using the
List object with a number of different syntaxes, but I get "error occurred
while evaluating custom action attribute 'test'" errors.



<c:if test="${!empty schoolList}">

<c:if test="${!empty requestScope.schoolList}">

<c:if test="${!empty requestScope.schoolList[0]}">


What I really want to do is something like this:

<c:if test="${schoolList.size() > 0}">.


When I try it, I get this error:


[ServletException in:/WEB-INF/jsp/SchoolList.jsp]
javax.servlet.jsp.JspException: An error occurred while evaluating custom
action attribute "test" with value "${schoolList.size > 0}": The "."
operator was supplied with an index value of type "java.lang.String" to be
applied to a List or array, but that value cannot be converted to an
integer. (null)'


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message