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:
- java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- SetLocaleTag, SetLocaleTag
public abstract class SetLocaleSupport
- extends javax.servlet.jsp.tagext.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 java.lang.Object |
value
|
protected java.lang.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 |
|
Method Summary |
int |
doEndTag()
|
static java.util.Locale |
parseLocale(java.lang.String locale)
See parseLocale(String, String) for details. |
static java.util.Locale |
parseLocale(java.lang.String locale,
java.lang.String variant)
Parses the given locale string into its language and (optionally)
country components, and returns the corresponding
java.util.Locale object. |
void |
release()
|
void |
setScope(java.lang.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 |
value
protected java.lang.Object value
variant
protected java.lang.String variant
SetLocaleSupport
public SetLocaleSupport()
setScope
public void setScope(java.lang.String scope)
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
release
public void release()
- Specified by:
release in interface javax.servlet.jsp.tagext.Tag- Overrides:
release in class javax.servlet.jsp.tagext.TagSupport
parseLocale
public static java.util.Locale parseLocale(java.lang.String locale)
- See parseLocale(String, String) for details.
parseLocale
public static java.util.Locale parseLocale(java.lang.String locale,
java.lang.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 parsevariant - 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:
java.lang.IllegalArgumentException - if the given locale does not have a
language component or has an empty country component
Copyright (c) 1999-2012 Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.