org.apache.taglibs.i18n
Class LocaleTag

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

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

This tag defines a Locale context for use by other inner JSP tags. If no locale has been configured directly via the "locale" property then the language, country and optional varient properties are used to create a new Locale instance. If these properties are not specified then the Locale is taken from ServletRequest is used. If still no Locale could be found then the default JVM Locale is used.

Version:
$Revision$
Author:
James Strachan
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
LocaleTag()
           
 
Method Summary
 int doEndTag()
          Sets the response locale if the changeResponseLocale attribute was set to true, OR if changeResponseLocale was unset and the tag was empty
 int doStartTag()
           
protected  java.util.Locale getLocale()
           
 void release()
           
 void setChangeResponseLocale(boolean value)
           
 void setCountry(java.lang.String country)
           
 void setLanguage(java.lang.String language)
           
 void setLocale(java.util.Locale locale)
           
 void setLocaleRef(java.lang.String value)
          Provides a key to retrieve a locale via findAttribute()
 void setVariant(java.lang.String variant)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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
 

Constructor Detail

LocaleTag

public LocaleTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Sets the response locale if the changeResponseLocale attribute was set to true, OR if changeResponseLocale was unset and the tag was empty

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

setChangeResponseLocale

public void setChangeResponseLocale(boolean value)

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

getLocale

protected final java.util.Locale getLocale()

setLocale

public final void setLocale(java.util.Locale locale)

setLocaleRef

public final void setLocaleRef(java.lang.String value)
Provides a key to retrieve a locale via findAttribute()


setLanguage

public final void setLanguage(java.lang.String language)

setCountry

public final void setCountry(java.lang.String country)

setVariant

public final void setVariant(java.lang.String variant)


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