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 HiddenTag extends BaseFieldTag { 31 32 33 35 38 public HiddenTag() { 39 40 super(); 41 this.type = "hidden"; 42 43 } 44 45 46 48 49 52 protected boolean write = false; 53 54 public boolean getWrite() { 55 return (this.write); 56 } 57 58 public void setWrite(boolean write) { 59 this.write = write; 60 } 61 62 63 65 66 72 public int doStartTag() throws JspException { 73 74 super.doStartTag(); 76 77 if (!write) { 79 return (EVAL_BODY_TAG); 80 } 81 82 83 String results = null; 86 if (value != null) { 87 results = TagUtils.getInstance().filter(value); 88 } else { 89 Object value = TagUtils.getInstance().lookup(pageContext, name, property, 90 null); 91 if (value == null) { 92 results = ""; 93 } else { 94 results = TagUtils.getInstance().filter(value.toString()); 95 } 96 } 97 98 TagUtils.getInstance().write(pageContext, results); 99 return (EVAL_BODY_TAG); 100 101 } 102 103 104 107 public void release() { 108 109 super.release(); 110 write = false; 111 112 } 113 114 115 } 116 | Popular Tags |