1 16 17 package org.apache.taglibs.page; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 55 56 public class ExistsAttributeTag extends TagSupport 57 { 58 private String name = null; 59 private boolean value = true; 60 61 66 public final int doStartTag() throws JspException 67 { 68 boolean result = false; 69 if( pageContext.getAttribute(name) != null ) 70 result = true; 71 72 if( value == result ) 73 return EVAL_BODY_INCLUDE; 74 75 return SKIP_BODY; 76 } 77 78 83 public final void setName(String str) 84 { 85 name = str; 86 } 87 88 93 public final void setValue(boolean value) 94 { 95 this.value = value; 96 } 97 98 } 99 | Popular Tags |