|
HDIV API 2.0.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts2.components.Component
org.apache.struts2.components.Text
org.hdiv.components.TextHDIV
public class TextHDIV
Render a I18n text message.
The message must be in a resource bundle with the same name as the action that it is associated with. In practice this means that you should create a properties file in the same package as your Java class with the same name as your class, but with .properties extension. If the named message is not found, then the body of the tag will be used as default message. If no body is used, then the name of the message will be used.Accessing messages from a given bundle (the i18n Shop example bundle in the first example) and using bundle defined through the framework in the second example.
<!-- First Example -->
<s:i18n name="struts.action.test.i18n.Shop">
<s:text name="main.title"/>
</s:i18n>
<!-- Second Example -->
<s:text name="main.title" />
<!-- Third Examlpe -->
<s:text name="i18n.label.greetings">
<s:param >Mr Smith</s:param>
</s:text>
<-- Fourth Example -->
<s:text name="some.key" />
<-- Fifth Example -->
<s:text name="some.invalid.key" >
The Default Message That Will Be Displayed
</s:text>
Param| Field Summary |
|---|
| Fields inherited from class org.apache.struts2.components.Text |
|---|
actualName, name, values |
| Fields inherited from class org.apache.struts2.components.Component |
|---|
actionMapper, COMPONENT_STACK, id, parameters, stack |
| Constructor Summary | |
|---|---|
TextHDIV(com.opensymphony.xwork2.util.ValueStack stack)
|
|
| Method Summary |
|---|
| Methods inherited from class org.apache.struts2.components.Text |
|---|
addParameter, addParameter, end, setName, usesBody |
| Methods inherited from class org.apache.struts2.components.Component |
|---|
addAllParameters, altSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setActionMapper, setId, start, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextHDIV(com.opensymphony.xwork2.util.ValueStack stack)
|
HDIV 2.0.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||