KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > collection > NestedCollectionTag


1 package fr.improve.struts.taglib.layout.collection;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6 import fr.improve.struts.taglib.layout.util.TagUtils;
7
8 /**
9  * Tag permettant de faire des itérations imbriquées.
10  * @author jer80876
11  */

12 public class NestedCollectionTag extends TagSupport JavaDoc {
13     protected String JavaDoc name;
14     protected String JavaDoc property;
15     protected String JavaDoc id;
16     protected String JavaDoc indexId;
17
18     protected CollectionTag collectionTag;
19     
20     public int doStartTag() throws JspException JavaDoc {
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 JavaDoc e) {
27             TagUtils.saveException(pageContext, e);
28             throw new JspException JavaDoc(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     /**
48      * Returns the id.
49      * @return String
50      */

51     public String JavaDoc getId() {
52         return id;
53     }
54
55     /**
56      * Returns the property.
57      * @return String
58      */

59     public String JavaDoc getProperty() {
60         return property;
61     }
62
63     /**
64      * Sets the id.
65      * @param id The id to set
66      */

67     public void setId(String JavaDoc id) {
68         this.id = id;
69     }
70
71     /**
72      * Sets the property.
73      * @param property The property to set
74      */

75     public void setProperty(String JavaDoc property) {
76         this.property = property;
77     }
78
79     /**
80      * Returns the indexId.
81      * @return String
82      */

83     public String JavaDoc getIndexId() {
84         return indexId;
85     }
86
87     /**
88      * Sets the indexId.
89      * @param indexId The indexId to set
90      */

91     public void setIndexId(String JavaDoc indexId) {
92         this.indexId = indexId;
93     }
94
95     /**
96      * @return
97      */

98     public String JavaDoc getName() {
99         return name;
100     }
101
102     /**
103      * @param string
104      */

105     public void setName(String JavaDoc string) {
106         name = string;
107     }
108
109 }
110
Popular Tags