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