Commits

Anonymous committed afe3596

Expose the size of the collection as 'listSize' parameter so that it can be used from the template.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@292573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (1)

src/java/com/opensymphony/webwork/views/jsp/ui/AbstractListTag.java

 
     public void evaluateExtraParams(OgnlValueStack stack) {
         if (listAttr != null) {
-            addParam("list", MakeIterator.convert(findValue(listAttr)));
+            Object value = findValue(listAttr);
+            addParam("list", MakeIterator.convert(value));
+            if (value instanceof Collection) {
+                addParam("listSize", new Integer(((Collection) value).size()));
+            }
         }
 
         if (listKeyAttr != null) {