Hello
I'm new to JSTL and got this jsp:
<%@ page import='java.util.*' %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<head>
<body>
<%
ArrayList myList = new ArrayList();
request.setAttribute("list", myList);
%>
<c:if test="${list.size == 0}">
TRUE
</c:if>
Can't get it to work. Error:
An error occurred while evaluating custom action attribute "test" with value "${list.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)
Also tried the expression
${fn:length(list) == 0}
but got error:
<h3>PWC6170: Validation error messages from TagLibraryValidator for c</h3><p>9: tag = 'if' / attribute = 'test': An error occurred while parsing custom action attribute "test" with value "${fn:length(list) == 0}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.</p>
Please give me a hint on how to simply test the size of a List.
I'm running Jetty 6.0.2 and started with struts-blank app from Struts 1.3.5
Bye,
F Lind.