Bug 11590

Summary: Can' access array size
Product: Taglibs Reporter: Eric Jain <eric.jain>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Eric Jain 2002-08-09 14:06:30 UTC
If 'list' is a java.util.ArrayList, shouldn't the variable be cast to an 
integer representing its size in the following expression:

<jstl:if test="${list < 10}">

rather than failing with 'Attempt to coerce a value of 
type "java.util.ArrayList" to type "java.lang.Long"'? Note that the method 
List.size() can't be called,  as list.size is mapped to either List.get("size") 
or List.getSize(), neither of which exist.
Comment 1 Shawn Bayern 2002-08-09 14:13:29 UTC
That's not a bad idea; in fact, I think it might work.  However, the JSTL 1.0 
specification does call for it, so this is not the right venue to offer the 
suggestion.  If you mail jsr-52-comments@jcp.org, the comment will be recorded 
for future versions of JSTL.
Comment 2 Shawn Bayern 2002-08-09 14:39:12 UTC
Of course, I meant "does _not_ call for it".  :-)