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.logic;
22
23 import org.apache.struts.taglib.logic.ForwardTag;
24 import org.apache.strutsel.taglib.utils.EvalHelper;
25
26 import javax.servlet.jsp.JspException;
27
28 /**
29 * Perform a forward or redirect to a page that is looked up in the
30 * configuration information associated with our application. <p> This class
31 * is a subclass of the class <code>org.apache.struts.taglib.logix.ForwardTag</code>
32 * which provides most of the described functionality. This subclass allows
33 * all attribute values to be specified as expressions utilizing the
34 * JavaServer Pages Standard Library expression language.
35 *
36 * @version $Rev: 471754 $
37 */
38 public class ELForwardTag extends ForwardTag {
39 /**
40 * Instance variable mapped to "name" tag attribute. (Mapping set in
41 * associated BeanInfo class.)
42 */
43 private String nameExpr;
44
45 /**
46 * Getter method for "name" tag attribute. (Mapping set in associated
47 * BeanInfo class.)
48 */
49 public String getNameExpr() {
50 return (nameExpr);
51 }
52
53 /**
54 * Setter method for "name" tag attribute. (Mapping set in associated
55 * BeanInfo class.)
56 */
57 public void setNameExpr(String nameExpr) {
58 this.nameExpr = nameExpr;
59 }
60
61 /**
62 * Resets attribute values for tag reuse.
63 */
64 public void release() {
65 super.release();
66 setNameExpr(null);
67 }
68
69 /**
70 * Process the start tag.
71 *
72 * @throws JspException if a JSP exception has occurred
73 */
74 public int doStartTag() throws JspException {
75 evaluateExpressions();
76
77 return (super.doStartTag());
78 }
79
80 /**
81 * Processes all attribute values which use the JSTL expression evaluation
82 * engine to determine their values.
83 *
84 * @throws JspException if a JSP exception has occurred
85 */
86 private void evaluateExpressions()
87 throws JspException {
88 String string = null;
89
90 if ((string =
91 EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
92 setName(string);
93 }
94 }
95 }