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.html;
22
23 import org.apache.struts.taglib.html.TextareaTag;
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 * NestedTextareaTag.
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 NestedTextareaTag extends TextareaTag implements NestedNameSupport {
38
39 private String originalName = null;
40 private String originalProperty = null;
41
42 /**
43 * Overriding method of the heart of the matter. Gets the relative
44 * property and leaves the rest up to the original tag implementation.
45 * Sweet.
46 *
47 * @return int JSP continuation directive. This is in the hands of the
48 * super class.
49 */
50 public int doStartTag() throws JspException {
51
52 originalName = getName();
53 originalProperty = getProperty();
54
55
56 HttpServletRequest request =
57 (HttpServletRequest) pageContext.getRequest();
58
59
60 NestedPropertyHelper.setNestedProperties(request, this);
61
62
63 return super.doStartTag();
64 }
65
66 /**
67 * Complete the processing of the tag. The nested tags here will restore
68 * all the original value for the tag itself and the nesting context.
69 *
70 * @return int to describe the next step for the JSP processor
71 * @throws JspException for the bad things JSP's do
72 */
73 public int doEndTag() throws JspException {
74
75 int i = super.doEndTag();
76
77
78 setName(originalName);
79 setProperty(originalProperty);
80
81
82 return i;
83 }
84
85 /**
86 * Release the tag's resources and reset the values.
87 */
88 public void release() {
89 super.release();
90
91
92 originalName = null;
93 originalProperty = null;
94 }
95 }