I'm making heavy use of ArrayList in some JSP pages. I would like to access an ArrayList like so:
${myArrayList.size}
But since objects must to conform to the JavaBean standard, where myArrayList.getMyPropertyName()
is ${myArrayList.myPropertyName}
in JSP/JSTL, the myArrayList.size()
function is not accessible.
Is there another class I should be using?
Update:
It's a bit difficult to accept that a feature such as getting the size of your ArrayList in JSP is left out just for cleaner one liners but it seems there can be other reasons the designers chose .size()
instead of .getSize()
I guess this really isn't a problem if you have support for ${fn:length(myArrayList)}
or ${myArrayList.getSize()}
syntax.