1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.strutsel.taglib.tiles;
22
23 import org.apache.struts.tiles.taglib.PutListTag;
24 import org.apache.strutsel.taglib.utils.EvalHelper;
25
26 import javax.servlet.jsp.JspException;
27
28 /**
29 * PutList tag implementation. <p> This class is a subclass of the class
30 * <code>org.apache.struts.taglib.tiles.PutListTag</code> which provides most
31 * of the described functionality. This subclass allows all attribute values
32 * to be specified as expressions utilizing the JavaServer Pages Standard
33 * Library expression language.
34 *
35 * @version $Rev: 471754 $
36 */
37 public class ELPutListTag extends PutListTag {
38 /**
39 * Instance variable mapped to "name" tag attribute. (Mapping set in
40 * associated BeanInfo class.)
41 */
42 private String nameExpr;
43
44 /**
45 * Getter method for "name" tag attribute. (Mapping set in associated
46 * BeanInfo class.)
47 */
48 public String getNameExpr() {
49 return (nameExpr);
50 }
51
52 /**
53 * Setter method for "name" tag attribute. (Mapping set in associated
54 * BeanInfo class.)
55 */
56 public void setNameExpr(String nameExpr) {
57 this.nameExpr = nameExpr;
58 }
59
60 /**
61 * Resets attribute values for tag reuse.
62 */
63 public void release() {
64 super.release();
65 setNameExpr(null);
66 }
67
68 /**
69 * Process the start tag.
70 *
71 * @throws JspException if a JSP exception has occurred
72 */
73 public int doStartTag() throws JspException {
74 evaluateExpressions();
75
76 return (super.doStartTag());
77 }
78
79 /**
80 * Processes all attribute values which use the JSTL expression evaluation
81 * engine to determine their values.
82 *
83 * @throws JspException if a JSP exception has occurred
84 */
85 private void evaluateExpressions()
86 throws JspException {
87 String string = null;
88
89 if ((string =
90 EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
91 setName(string);
92 }
93 }
94 }