1 23 24 package org.dbforms.taglib; 25 26 import javax.servlet.jsp.JspException ; 27 28 29 30 39 public class DbTextFieldTag extends DbBaseInputTag 40 implements javax.servlet.jsp.tagext.TryCatchFinally { 41 private java.lang.String password = "false"; 42 43 48 public void setPassword(String pwd) { 49 this.password = pwd; 50 } 51 52 53 58 public String getPassword() { 59 return this.password; 60 } 61 62 63 66 public void doCatch(Throwable t) throws Throwable { 67 throw t; 68 } 69 70 71 79 public int doEndTag() throws JspException { 80 try { 81 82 StringBuffer tagBuf = new StringBuffer ("<input "); 83 84 if ("true".equals(this.getPassword())) { 85 tagBuf.append("type=\"password\" "); 86 } else { 87 tagBuf.append(prepareType()); 88 } 89 90 tagBuf.append(prepareName()); 91 tagBuf.append(prepareValue()); 92 tagBuf.append(prepareSize()); 93 tagBuf.append(prepareKeys()); 94 tagBuf.append(prepareStyles()); 95 tagBuf.append(prepareEventHandlers()); 96 tagBuf.append("/>"); 97 98 pageContext.getOut() 99 .write(tagBuf.toString()); 100 101 writeOutSpecialValues(); 103 104 getParentForm() 106 .addChildName(getName(), getFormFieldName()); 107 } catch (java.io.IOException ioe) { 108 throw new JspException ("IO Error: " + ioe.getMessage()); 109 } 110 111 return EVAL_PAGE; 112 } 113 114 115 118 public void doFinally() { 119 password = "false"; 120 super.doFinally(); 121 } 122 123 124 131 public int doStartTag() throws JspException { 132 super.doStartTag(); 133 134 return SKIP_BODY; 135 } 136 } 137 | Popular Tags |