View Javadoc

1   /*
2    * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/taglib/DbTextAreaForBlobsTag.java,v 1.13 2006/01/13 13:38:51 hkollmann Exp $
3    * $Revision: 1.13 $
4    * $Date: 2006/01/13 13:38:51 $
5    *
6    * DbForms - a Rapid Application Development Framework
7    * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8    *
9    * This library is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public
11   * License as published by the Free Software Foundation; either
12   * version 2.1 of the License, or (at your option) any later version.
13   *
14   * This library is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this library; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
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     // logging category for this class
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 }