1 16 17 package org.apache.taglibs.response; 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 ContainsHeaderTag 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 = 69 ((HttpServletResponse)pageContext.getResponse()).containsHeader(name); 70 71 if( value == result ) 72 return EVAL_BODY_INCLUDE; 73 74 return SKIP_BODY; 75 } 76 77 82 public final void setValue(boolean value) 83 { 84 this.value = value; 85 } 86 87 92 public final void setName(String nam) 93 { 94 name = nam; 95 } 96 97 } 98 | Popular Tags |