1 16 17 package org.apache.taglibs.request; 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 ExistsHeaderTag 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 if( ((HttpServletRequest)pageContext.getRequest()).getHeader(name) != null ) 72 result = true; 73 74 if( value == result ) 75 return EVAL_BODY_INCLUDE; 76 77 return SKIP_BODY; 78 } 79 80 85 public final void setName(String str) 86 { 87 name = str; 88 } 89 90 95 public final void setValue(boolean value) 96 { 97 this.value = value; 98 } 99 100 } 101 | Popular Tags |