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