1 7 package com.inversoft.verge.mvc.view.jsp.html; 8 9 10 import java.io.IOException ; 11 12 import javax.servlet.jsp.JspException ; 13 14 import org.apache.log4j.Logger; 15 16 import com.inversoft.util.ObjectTools; 17 import com.inversoft.verge.mvc.view.HtmlViewToolkit; 18 19 20 26 public class TextTag extends InputTag { 27 28 31 private static final Logger logger = Logger.getLogger(TextTag.class); 32 33 34 40 public int doStartTag() throws JspException { 41 42 initialize(); 45 46 StringBuffer buf = new StringBuffer (); 47 createTextTag(buf, getId(), localName, localValue); 48 49 if (logger.isDebugEnabled()) { 50 logger.debug("The text tag: " + buf.toString()); 51 logger.debug("id: " + toString()); 52 } 53 54 try { 55 pageContext.getOut().print(buf.toString()); 56 } catch (IOException ioe) { 57 throw new JspException (ioe.toString()); 58 } 59 60 return SKIP_BODY; 61 } 62 63 72 protected void createTextTag(StringBuffer buf, String id, String name, 73 Object value) 74 throws JspException { 75 String valueStr = ObjectTools.toString(value); 76 HtmlViewToolkit.createTextTag(buf, id, name, valueStr, attributes, 77 singleAttrs); 78 } 79 } | Popular Tags |