1 23 package org.infoglue.deliver.taglib.common; 24 25 import java.util.Collection ; 26 27 import javax.servlet.jsp.JspException ; 28 29 import org.infoglue.deliver.taglib.AbstractTag; 30 31 35 public class SizeTag extends AbstractTag 36 { 37 40 private static final long serialVersionUID = 8603406098980150888L; 41 42 45 private Collection collection; 46 47 50 public SizeTag() 51 { 52 super(); 53 } 54 55 61 public int doEndTag() throws JspException 62 { 63 setResultAttribute(new Integer (collection == null ? 0 : collection.size())); 64 return EVAL_PAGE; 65 } 66 67 74 public void setList(final String collection) throws JspException 75 { 76 this.collection = evaluateCollection("size", "list", collection); 77 } 78 } 79 | Popular Tags |