## org.apache.taglibs.standard.tag.common.fmt
Class SetLocaleSupport

    java.lang.Object
      javax.servlet.jsp.tagext.TagSupport
          org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport

All Implemented Interfaces:
  Serializable, IterationTag, JspTag, Tag

Direct Known Subclasses:
  SetLocaleTag, SetLocaleTag

    public abstract class SetLocaleSupport

extends TagSupport

Support for tag handlers for <setLocale>, the locale setting tag in JSTL 1.0.

Author:
  Jan Luehe
See Also:
  Serialized Form

Field Summary
`protected Object` `value`
`protected String` `variant`

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
`SetLocaleSupport()`

Method Summary
`int` `doEndTag()` Default processing of the end tag returning EVAL_PAGE.
`static Locale` `parseLocale(String locale)` See parseLocale(String, String) for details.
`static Locale` `parseLocale(String locale, String variant)` Parses the given locale string into its language and (optionally) country components, and returns the corresponding `java.util.Locale` object.
`void` `release()` Release state.
`void` `setScope(String scope)`

Methods inherited from class javax.servlet.jsp.tagext.TagSupport
`doAfterBody, doStartTag, 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`

Field Detail

### value

    protected Object value

### variant

    protected String variant

Constructor Detail

### SetLocaleSupport

    public SetLocaleSupport()

Method Detail

### setScope

    public void setScope(String scope)

### doEndTag

    public int doEndTag()
                 throws JspException

  Description copied from class: `TagSupport`
  Default processing of the end tag returning EVAL_PAGE.

  Specified by:
    `doEndTag` in interface `Tag`
  Overrides:
    `doEndTag` in class `TagSupport`
  Returns:
    EVAL_PAGE
  Throws:
    `JspException` - if an error occurs while processing this tag
  See Also:
    `Tag.doEndTag()`

### release

    public void release()

  Description copied from class: `TagSupport`
  Release state.

  Specified by:
    `release` in interface `Tag`
  Overrides:
    `release` in class `TagSupport`
  See Also:
    `Tag.release()`

### parseLocale

    public static Locale parseLocale(String locale)

  See parseLocale(String, String) for details.

### parseLocale

    public static Locale parseLocale(String locale,
                                     String variant)

  Parses the given locale string into its language and (optionally) country components, and returns the corresponding `java.util.Locale` object. If the given locale string is null or empty, the runtime's default locale is returned.

  Parameters:
    `locale` - the locale string to parse
    `variant` - the variant
  Returns:
    `java.util.Locale` object corresponding to the given locale string, or the runtime's default locale if the locale string is null or empty
  Throws:
    `IllegalArgumentException` - if the given locale does not have a language component or has an empty country component

Copyright © 2008 Mort Bay Consulting. All Rights Reserved.