org.apache.taglibs.request
Class EqualsHeaderTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.taglibs.request.EqualsHeaderTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class EqualsHeaderTag
extends javax.servlet.jsp.tagext.TagSupport

JSP Tag equalsHeader, used to determine if a Request header equals the value of the "match" tag attribute.

Includes the body of the tag if the header equals the value of the "match" tag header.

You can set the optional tag header value to true or false. The body of the tag is included if equalsHeader matches the value.

You can set the optional tag header ignoreCase to true or false. If ignoreCase is set to true, then the comparison between the request header and the "match" tag attribute will not be case-sensitive.

JSP Tag Lib Descriptor

 <name>equalsHeader</name>
 <tagclass>org.apache.taglibs.request.EqualsHeaderTag</tagclass>
 <bodycontent>JSP</bodycontent>
 <info>Includes the body of the tag if the request header equals the
 value of the "match" tag header.</info>
   <header>
     <name>name</name>
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
   </header>
   <header>
     <name>value</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </header>
   <header>
     <name>match</name>
     <required>true</required>
     <rtexprvalue>true</rtexprvalue>
   </header>
   <header>
     <name>ignoreCase</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </header>
 

Author:
Glenn Nielsen
See Also:
Serialized Form

Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
EqualsHeaderTag()
           
 
Method Summary
 int doStartTag()
          Includes the body of the tag if the request header equals the value set in the 'match' header.
 void setIgnoreCase(boolean value)
          If ignoreCase is set to true, then the comparison between the "match" attribute and the request header will not be case sensitive
 void setMatch(java.lang.String str)
          Set the String that will be compared to the request header.
 void setName(java.lang.String str)
          Set the required tag header name.
 void setValue(boolean value)
          Set the optional tag header value to true or false.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EqualsHeaderTag

public EqualsHeaderTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Includes the body of the tag if the request header equals the value set in the 'match' header.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY if equalsHeader body content does not equal the value of the match header, EVAL_BODY_include if it does

setName

public final void setName(java.lang.String str)
Set the required tag header name.
Parameters:
String - name of request header

setMatch

public final void setMatch(java.lang.String str)
Set the String that will be compared to the request header.
Parameters:
String - value to match against the request header

setIgnoreCase

public final void setIgnoreCase(boolean value)
If ignoreCase is set to true, then the comparison between the "match" attribute and the request header will not be case sensitive
Parameters:
boolean - true = ignore case
false = case sensitive
default value = false

setValue

public final void setValue(boolean value)
Set the optional tag header value to true or false.
Parameters:
boolean - true or false


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.