Package org.apache.struts2.components
Class I18n
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.I18n
Gets a resource bundle and place it on the value stack. This allows
the text tag to access messages from any bundle, and not just the bundle
associated with the current action.
- name* - the resource bundle's name (eg foo/bar/customBundle)
Example:
<s:i18n name="myCustomBundle">
The i18n value for key aaa.bbb.ccc in myCustomBundle is <s:property value="text('aaa.bbb.ccc')" />
</s:i18n>
<s:i18n name="some.package.bundle" >
<s:text name="some.key" />
</s:i18n>
-
Field Summary
FieldsFields inherited from class org.apache.struts2.components.Component
actionMapper, attributes, COMPONENT_STACK, devMode, escapeHtmlBody, performClearTagStateForTagPoolingServers, stack, standardAttributesMap, throwExceptionOnELFailure -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCallback for the end tag of this component.voidsetLocaleProviderFactory(LocaleProviderFactory localeProviderFactory) voidsetLocalizedTextProvider(LocalizedTextProvider localizedTextProvider) voidvoidsetTextProvider(TextProvider textProvider) voidsetTextProviderFactory(TextProviderFactory textProviderFactory) booleanCallback for the start tag of this component.Methods inherited from class org.apache.struts2.components.Component
addAllAttributes, addParameter, completeExpression, copyAttributes, determineActionURL, determineNamespace, end, escapeHtmlBody, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getAttributes, getComponentStack, getNamespace, getPerformClearTagStateForTagPoolingServers, getStack, getStandardAttributes, isAcceptableExpression, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setEscapeHtmlBody, setNotExcludedAcceptedPatterns, setPerformClearTagStateForTagPoolingServers, setThrowExceptionsOnELFailure, setUrlHelper, stripExpression, toString, usesBody
-
Field Details
-
pushed
protected boolean pushed -
name
-
-
Constructor Details
-
I18n
-
-
Method Details
-
setLocalizedTextProvider
-
setTextProvider
-
setTextProviderFactory
-
setLocaleProviderFactory
-
start
Description copied from class:ComponentCallback for the start tag of this component. Should the body be evaluated? -
end
Description copied from class:ComponentCallback for the end tag of this component. Should the body be evaluated again?
NOTE: will pop component stack.- Overrides:
endin classComponent- Parameters:
writer- the output writer.body- the rendered body.- Returns:
- true if the body should be evaluated again
- Throws:
StrutsException
-
setName
-