org.apache.struts2.components
类 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>
构造方法摘要 |
I18n(com.opensymphony.xwork2.util.ValueStack stack)
|
方法摘要 |
boolean |
end(Writer writer,
String body)
Callback for the end tag of this component. |
void |
setContainer(com.opensymphony.xwork2.inject.Container container)
|
void |
setName(String name)
|
boolean |
start(Writer writer)
Callback for the start tag of this component. |
从类 org.apache.struts2.components.Component 继承的方法 |
addAllParameters, addParameter, altSyntax, copyParams, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, usesBody |
I18n
public I18n(com.opensymphony.xwork2.util.ValueStack stack)
setContainer
public void setContainer(com.opensymphony.xwork2.inject.Container container)
start
public boolean start(Writer writer)
- 从类
Component
复制的描述
- Callback for the start tag of this component.
Should the body be evaluated?
- 覆盖:
- 类
Component
中的 start
- 参数:
writer
- the output writer.
- 返回:
- true if the body should be evaluated
end
public boolean end(Writer writer,
String body)
throws StrutsException
- 从类
Component
复制的描述
- Callback for the end tag of this component.
Should the body be evaluated again?
NOTE: will pop component stack.
- 覆盖:
- 类
Component
中的 end
- 参数:
writer
- the output writer.body
- the rendered body.
- 返回:
- true if the body should be evaluated again
- 抛出:
StrutsException
setName
public void setName(String name)