Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.components
Class I18n

    java.lang.Object
      org.apache.struts2.components.Component
          org.apache.struts2.components.I18n

    public class I18n

extends Component

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
`protected Container` | `container`
`protected String` | `name`
`protected boolean` | `pushed`

Fields inherited from class org.apache.struts2.components.Component
`actionMapper, COMPONENT_STACK, devMode, parameters, stack, standardAttributesMap, throwExceptionOnELFailure`

Constructor Summary
`I18n(ValueStack stack)`

Method Summary
`boolean` | `end(Writer writer, String body)` Callback for the end tag of this component.
`void` | `setContainer(Container container)`
`void` | `setLocaleProvider(LocaleProvider localeProvider)`
`void` | `setName(String name)`
`void` | `setTextProvider(TextProvider textProvider)`
`boolean` | `start(Writer writer)` Callback for the start tag of this component.

Methods inherited from class org.apache.struts2.components.Component
`addAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, getStandardAttributes, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString, usesBody`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### pushed

    protected boolean pushed

### name

    protected String name

### container

    protected Container container

Constructor Detail

### I18n

    public I18n(ValueStack stack)

Method Detail

### setContainer

    public void setContainer(Container container)

### setTextProvider

    public void setTextProvider(TextProvider textProvider)

### setLocaleProvider

    public void setLocaleProvider(LocaleProvider localeProvider)

### start

    public boolean start(Writer writer)

  Description copied from class: `Component`
  Callback for the start tag of this component. Should the body be evaluated?

  Overrides:
    `start` in class `Component`
  Parameters:
    `writer` - the output writer.
  Returns:
    true if the body should be evaluated

### end

    public boolean end(Writer writer,
                       String body)
                throws StrutsException

  Description copied from class: `Component`
  Callback for the end tag of this component. Should the body be evaluated again?

  NOTE: will pop component stack.

  Overrides:
    `end` in class `Component`
  Parameters:
    `writer` - the output writer.
    `body` - the rendered body.
  Returns:
    true if the body should be evaluated again
  Throws:
    `StrutsException`

### setName

    public void setName(String name)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.