1 16 17 package org.apache.taglibs.session; 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; 60 private boolean value = true; 62 63 68 public final int doStartTag() throws JspException 69 { 70 boolean result = false; 71 72 if( pageContext.getSession().getAttribute(name) != null ) 74 result = true; 75 76 if( value == result ) 77 return EVAL_BODY_INCLUDE; 78 return SKIP_BODY; 79 } 80 81 86 public final void setName(String str) 87 { 88 name = str; 89 } 90 91 96 public final void setValue(boolean value) 97 { 98 this.value = value; 99 } 100 101 } 102 | Popular Tags |