Possible duplicate:
Access to collection size in JSP / JSTL / EL
I use ArrayList in some JSP pages. I would like to access the ArrayList as follows:
${myArrayList.size}
But since the objects must comply with the JavaBean standard, where myArrayList.getMyPropertyName()there is ${myArrayList.myPropertyName}in JSP / JSTL, the function is myArrayList.size()not available.
Is there any other class that I should use?
Update:
It's a little tricky to admit that a feature, such as getting the size of your ArrayList in JSP, is reserved only for cleaner liners, but there may be other reasons why designers chose .size()instead.getSize()
I think this is really not a problem if you have syntax support ${fn:length(myArrayList)}or ${myArrayList.getSize()}.