1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.taglib;
25
26 import javax.servlet.jsp.*;
27
28
29
30 /***
31 * <p>
32 * This tag renders a HTML TextArea - Element
33 * </p>
34 * this tag renders a dabase-datadriven textArea, which is an active element -
35 * the user can change data
36 *
37 * @author Joachim Peer
38 */
39 public class DbTextAreaForBlobsTag extends DbTextAreaTag
40 implements javax.servlet.jsp.tagext.TryCatchFinally {
41
42 private String suffix;
43
44 /***
45 * DOCUMENT ME!
46 *
47 * @param suffix DOCUMENT ME!
48 */
49 public void setSuffix(String suffix) {
50 this.suffix = suffix;
51 }
52
53
54 /***
55 * DOCUMENT ME!
56 *
57 * @return DOCUMENT ME!
58 */
59 public String getSuffix() {
60 return suffix;
61 }
62
63
64 /***
65 * DOCUMENT ME!
66 *
67 * @return DOCUMENT ME!
68 *
69 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
70 * @throws JspException DOCUMENT ME!
71 */
72 public int doEndTag() throws javax.servlet.jsp.JspException {
73 try {
74 super.doEndTag();
75
76 StringBuffer suffixBuf = new StringBuffer("<input type=\"hidden\" name=\"");
77 suffixBuf.append("suffix_" + getFormFieldName());
78 suffixBuf.append("\" value=\"");
79 suffixBuf.append(suffix);
80 suffixBuf.append("\"/>");
81
82 pageContext.getOut()
83 .write(suffixBuf.toString());
84
85 StringBuffer fileNameBuf = new StringBuffer("<input type=\"hidden\" name=\"");
86 fileNameBuf.append("fn_" + getFormFieldName());
87 fileNameBuf.append("\" value=\"");
88 fileNameBuf.append(getFormFieldValue());
89 fileNameBuf.append("\"/>");
90
91 pageContext.getOut()
92 .write(fileNameBuf.toString());
93 } catch (java.io.IOException e) {
94 throw new JspException("IO Error: " + e.getMessage());
95 }
96
97 return EVAL_PAGE;
98 }
99
100
101 /***
102 * DOCUMENT ME!
103 */
104 public void doFinally() {
105 suffix = null;
106 super.doFinally();
107 }
108
109
110 /***
111 * DOCUMENT ME!
112 *
113 * @return DOCUMENT ME!
114 *
115 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
116 */
117 public int doStartTag() throws javax.servlet.jsp.JspException {
118 super.doStartTag();
119
120 return EVAL_BODY_BUFFERED;
121 }
122 }