1 18 19 package org.apache.struts.taglib.html; 20 21 import javax.servlet.jsp.JspException ; 22 23 import org.apache.struts.taglib.TagUtils; 24 25 30 public class TextareaTag extends BaseInputTag { 31 32 33 35 public TextareaTag () { 36 super(); 37 doReadonly = true; 38 } 39 40 42 43 49 public int doStartTag() throws JspException { 50 51 TagUtils.getInstance().write(pageContext, this.renderTextareaElement()); 52 53 return (EVAL_BODY_TAG); 54 } 55 56 61 protected String renderTextareaElement() throws JspException { 62 StringBuffer results = new StringBuffer ("<textarea"); 63 64 prepareAttribute(results, "name", prepareName()); 65 prepareAttribute(results, "accesskey", getAccesskey()); 66 prepareAttribute(results, "tabindex", getTabindex()); 67 prepareAttribute(results, "cols", getCols()); 68 prepareAttribute(results, "rows", getRows()); 69 results.append(prepareEventHandlers()); 70 results.append(prepareStyles()); 71 prepareOtherAttributes(results); 72 results.append(">"); 73 74 results.append(this.renderData()); 75 76 results.append("</textarea>"); 77 return results.toString(); 78 } 79 80 85 protected String renderData() throws JspException { 86 String data = this.value; 87 88 if (data == null) { 89 data = this.lookupProperty(this.name, this.property); 90 } 91 92 return (data == null) ? "" : TagUtils.getInstance().filter(data); 93 } 94 95 98 public void release() { 99 100 super.release(); 101 name = Constants.BEAN_KEY; 102 103 } 104 105 } 106 | Popular Tags |