1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.struts.taglib.nested.logic;
22
23 import org.apache.struts.taglib.logic.GreaterEqualTag;
24 import org.apache.struts.taglib.nested.NestedNameSupport;
25 import org.apache.struts.taglib.nested.NestedPropertyHelper;
26
27 import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.jsp.JspException;
29
30 /**
31 * NestedGreaterEqualTag.
32 *
33 * @version $Rev: 471754 $ $Date: 2004-10-16 12:38:42 -0400 (Sat, 16 Oct 2004)
34 * $
35 * @since Struts 1.1
36 */
37 public class NestedGreaterEqualTag extends GreaterEqualTag
38 implements NestedNameSupport {
39
40 private String originalName = null;
41 private String originalProperty = null;
42
43 /**
44 * Overriding method of the heart of the matter. Gets the relative
45 * property and leaves the rest up to the original tag implementation.
46 * Sweet.
47 *
48 * @return int JSP continuation directive. This is in the hands of the
49 * super class.
50 */
51 public int doStartTag() throws JspException {
52
53 originalName = getName();
54 originalProperty = getProperty();
55
56
57 HttpServletRequest request =
58 (HttpServletRequest) pageContext.getRequest();
59
60
61 NestedPropertyHelper.setNestedProperties(request, this);
62
63
64 return super.doStartTag();
65 }
66
67 /**
68 * Complete the processing of the tag. The nested tags here will restore
69 * all the original value for the tag itself and the nesting context.
70 *
71 * @return int to describe the next step for the JSP processor
72 * @throws JspException for the bad things JSP's do
73 */
74 public int doEndTag() throws JspException {
75
76 int i = super.doEndTag();
77
78
79 setName(originalName);
80 setProperty(originalProperty);
81
82
83 return i;
84 }
85
86 /**
87 * Release the tag's resources and reset the values.
88 */
89 public void release() {
90 super.release();
91
92
93 originalName = null;
94 originalProperty = null;
95 }
96 }