1 package fr.improve.struts.taglib.layout.collection; 2 3 import javax.servlet.jsp.JspException ; 4 import javax.servlet.jsp.tagext.TagSupport ; 5 6 import fr.improve.struts.taglib.layout.util.TagUtils; 7 8 12 public class NestedCollectionTag extends TagSupport { 13 protected String name; 14 protected String property; 15 protected String id; 16 protected String indexId; 17 18 protected CollectionTag collectionTag; 19 20 public int doStartTag() throws JspException { 21 CollectionTag lc_collectionTag = (CollectionTag) findAncestorWithClass(this, CollectionTag.class); 22 23 if (lc_collectionTag.isFirst()) try { 24 CollectionsIterator lc_iterator = new CollectionsIterator(null, property, id, indexId); 25 lc_collectionTag.addIterator(lc_iterator); 26 } catch (Exception e) { 27 TagUtils.saveException(pageContext, e); 28 throw new JspException (e.getMessage()); 29 } 30 31 return EVAL_BODY_INCLUDE; 32 } 33 34 public int doEndTag() { 35 return EVAL_PAGE; 36 } 37 38 public void release() { 39 super.release(); 40 name = null; 41 property = null; 42 id = null; 43 indexId = null; 44 } 45 46 47 51 public String getId() { 52 return id; 53 } 54 55 59 public String getProperty() { 60 return property; 61 } 62 63 67 public void setId(String id) { 68 this.id = id; 69 } 70 71 75 public void setProperty(String property) { 76 this.property = property; 77 } 78 79 83 public String getIndexId() { 84 return indexId; 85 } 86 87 91 public void setIndexId(String indexId) { 92 this.indexId = indexId; 93 } 94 95 98 public String getName() { 99 return name; 100 } 101 102 105 public void setName(String string) { 106 name = string; 107 } 108 109 } 110 | Popular Tags |