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