org.apache.taglibs.application
Class EqualsInitParameterTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.taglibs.application.EqualsInitParameterTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

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

JSP Tag equalsInitParameter, used to determine if an init parameter equals the value of the "match" tag attribute.

Includes the body of the tag if the init parameter equals the value of the "match" tag attribute.

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

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

JSP Tag Lib Descriptor

 <name>equalsInitParameter</name>;
 <tagclass>org.apache.taglibs.application.EqualsInitParamaeterTag</tagclass>
 <bodycontent>JSP</bodycontent>
 <info>Includes the body of the tag if the init parameter equals the
 value of the "match" tag attribute.</info>
   <attribute>
     <name>name</name>
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
   <attribute>
     <name>value</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
   <attribute>
     <name>match</name>
     <required>true</required>
     <rtexprvalue>true</rtexprvalue>
   </attribute>
   <attribute>
     <name>ignoreCase</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
 

Author:
Morgan Delagrange
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
EqualsInitParameterTag()
           
 
Method Summary
 int doStartTag()
          Includes the body of the tag if the init parameter equals the value set in the 'match' attribute.
 void setIgnoreCase(boolean value)
          If ignoreCase is set to true, then the comparison between the "match" attribute and the init parameter will not be case sensitive
 void setMatch(java.lang.String str)
          Set the String that will be compared to the init parameter.
 void setName(java.lang.String str)
          Set the required tag attribute name.
 void setValue(boolean value)
          Set the optional tag attribute value to true or false.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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

EqualsInitParameterTag

public EqualsInitParameterTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Includes the body of the tag if the init parameter equals the value set in the 'match' attribute.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY if equalsInitParameter doesn't match value, EVAL_BODY_include if equalsInitParameter matches value
Throws:
javax.servlet.jsp.JspException

setName

public final void setName(java.lang.String str)
Set the required tag attribute name.

Parameters:
String - name of init parameter

setMatch

public final void setMatch(java.lang.String str)
Set the String that will be compared to the init parameter.

Parameters:
String - value to match against the init parameter

setIgnoreCase

public final void setIgnoreCase(boolean value)
If ignoreCase is set to true, then the comparison between the "match" attribute and the init parameter 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 attribute value to true or false.

Parameters:
boolean - true or false


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.