org.apache.taglibs.i18n
Class IfdefTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.i18n.ConditionalTagSupport
              extended by org.apache.taglibs.i18n.IfdefTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class IfdefTag
extends ConditionalTagSupport

This class implements body tag that allows you to use a resource bundle to internationalize content in a web page. If a value is found in the resource bundle for the required "key" attribute, then the enclosed JSP is evaluated, otherwise, it is skipped.

The ifdef and ifndef tags allow the JSP author to conditionally evaluate sections of a JSP based on whether or not a value is provided for the given key.

Examples

  <i18n:bundle baseName="test"/>
  <i18n:ifdef key="test">
  misc html and jsp
  </i18n:ifdef>
  etc...
  

Author:
Tim Dawson
See Also:
Serialized Form

Field Summary
protected static java.lang.String _tagname
           
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
IfdefTag()
           
 
Method Summary
 boolean shouldEvaluate()
          locates the bundle and tests whether the key has a value
 
Methods inherited from class org.apache.taglibs.i18n.ConditionalTagSupport
doEndTag, doStartTag, getBundle, getValue, release, setBundle, setBundleRef, setKey
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

_tagname

protected static final java.lang.String _tagname
See Also:
Constant Field Values
Constructor Detail

IfdefTag

public IfdefTag()
Method Detail

shouldEvaluate

public boolean shouldEvaluate()
                       throws javax.servlet.jsp.JspException
locates the bundle and tests whether the key has a value

Specified by:
shouldEvaluate in class ConditionalTagSupport
Throws:
javax.servlet.jsp.JspException


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