© 2002 BEA Systems, Inc.


com.bea.p13n.taglib.i18n
Class GetMessageTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.bea.p13n.taglib.i18n.I18nTag
              |
              +--com.bea.p13n.taglib.i18n.GetMessageTag

public class GetMessageTag
extends I18nTag

Corresponds to <i18n:getMessage>.

This tag is used in the localization of JSP pages and allows a page developer to retrieve localized static text or messages from a JspMessageBundle. All pages that have an internationalization requirement should use this tag to retrieve localized text.

This tag can be used in conjunction with the <i18n:localize> tag. You would want to do these tags in the same JSP page if the page is not being included in a larger page. If the page is being included in a larger page, that page should use the <i18n:localize> tag to make sure the page is properly encoded.

See the Javadoc for java.text.MessageFormat to understand the conceptual foundations for this tag.

Tag Parameters:

Tag Attribute

Required

Description

messageName

yes

The key for the message bundle.

messageArgs

no

The arguments to the message bundle. If no args are provided, it is assumed that static text (not a message) is to be returned.

For example, {"Wednesday", "78"}; might be used to construct the message "Today is Wednesday, and the temperature is 78 degrees."

bundleName

no

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute unless it is desired to use a different bundle for a particular tag invocation.

language

no

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different language for a particular tag invocation.

country

no

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different country for a particular tag invocation.

variant

no

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different variant for a particular tag invocation.

locale

no

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different locale (language, country, and variant) for a particular tag invocation.

id

no

Serves as an attribute to hold the value of the label (or message) in the JSP page.

See Also:
LocalizeTag, Serialized Form

Fields inherited from class com.bea.p13n.taglib.i18n.I18nTag
logLevel, printStackTraces, verbose
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Constructor Summary
GetMessageTag()
           
 
Method Summary
 int doStartTag()
           
 java.lang.String getBundleName()
           
 java.lang.String getCountry()
           
 java.lang.String getLanguage()
           
 java.util.Locale getLocale()
           
 java.lang.Object[] getMessageArgs()
           
 java.lang.String getMessageName()
           
 java.lang.String getVariant()
           
 void release()
           
 void setBundleName(java.lang.String bundleName)
           
 void setCountry(java.lang.String country)
           
 void setLanguage(java.lang.String language)
           
 void setLocale(java.util.Locale locale)
           
 void setMessageArgs(java.lang.Object[] messageArgs)
           
 void setMessageName(java.lang.String messageName)
           
 void setVariant(java.lang.String variant)
           
 
Methods inherited from class com.bea.p13n.taglib.i18n.I18nTag
debug, info, logLevelDebug, logLevelInfo, logLevelWarning, warning, warning
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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

GetMessageTag

public GetMessageTag()
Method Detail

release

public void release()

Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

setLanguage

public void setLanguage(java.lang.String language)

getLanguage

public java.lang.String getLanguage()

setCountry

public void setCountry(java.lang.String country)

getCountry

public java.lang.String getCountry()

setVariant

public void setVariant(java.lang.String variant)

getVariant

public java.lang.String getVariant()

setLocale

public void setLocale(java.util.Locale locale)

getLocale

public java.util.Locale getLocale()

setMessageName

public void setMessageName(java.lang.String messageName)

getMessageName

public java.lang.String getMessageName()

getMessageArgs

public java.lang.Object[] getMessageArgs()

setMessageArgs

public void setMessageArgs(java.lang.Object[] messageArgs)

getBundleName

public java.lang.String getBundleName()

setBundleName

public void setBundleName(java.lang.String bundleName)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved