KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > strutsel > taglib > tiles > ELPutListTag


1 /*
2  * $Id: ELPutListTag.java 54933 2004-10-16 17:04:52Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.strutsel.taglib.tiles;
20
21 import org.apache.struts.taglib.tiles.PutListTag;
22 import javax.servlet.jsp.JspException JavaDoc;
23 import org.apache.strutsel.taglib.utils.EvalHelper;
24
25 /**
26  * PutList tag implementation.
27  *<p>
28  * This class is a subclass of the class
29  * <code>org.apache.struts.taglib.tiles.PutListTag</code> which provides most of
30  * the described functionality. This subclass allows all attribute values to
31  * be specified as expressions utilizing the JavaServer Pages Standard Library
32  * expression language.
33  *
34  * @version $Rev: 54933 $
35  */

36 public class ELPutListTag extends PutListTag {
37
38     /**
39      * Instance variable mapped to "name" tag attribute.
40      * (Mapping set in associated BeanInfo class.)
41      */

42     private String JavaDoc nameExpr;
43
44     /**
45      * Getter method for "name" tag attribute.
46      * (Mapping set in associated BeanInfo class.)
47      */

48     public String JavaDoc getNameExpr() { return (nameExpr); }
49
50     /**
51      * Setter method for "name" tag attribute.
52      * (Mapping set in associated BeanInfo class.)
53      */

54     public void setNameExpr(String JavaDoc nameExpr) { this.nameExpr = nameExpr; }
55
56     /**
57      * Resets attribute values for tag reuse.
58      */

59     public void release()
60     {
61         super.release();
62         setNameExpr(null);
63     }
64     
65     /**
66      * Process the start tag.
67      *
68      * @exception JspException if a JSP exception has occurred
69      */

70     public int doStartTag() throws JspException JavaDoc {
71         evaluateExpressions();
72         return (super.doStartTag());
73     }
74     
75     /**
76      * Processes all attribute values which use the JSTL expression evaluation
77      * engine to determine their values.
78      *
79      * @exception JspException if a JSP exception has occurred
80      */

81     private void evaluateExpressions() throws JspException JavaDoc {
82         String JavaDoc string = null;
83
84         if ((string = EvalHelper.evalString("name", getNameExpr(),
85                                             this, pageContext)) != null)
86             setName(string);
87     }
88 }
89
Popular Tags