HDIV API 2.0.4

org.hdiv.components
Class TextHDIV

java.lang.Object
  extended by org.apache.struts2.components.Component
      extended by org.apache.struts2.components.Text
          extended by org.hdiv.components.TextHDIV
All Implemented Interfaces:
org.apache.struts2.components.Param.UnnamedParametric

public class TextHDIV
extends org.apache.struts2.components.Text

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.

Example:

 

 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>

 
 

Since:
HDIV 2.0
Author:
Gorka Vicente
See Also:
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

TextHDIV

public TextHDIV(com.opensymphony.xwork2.util.ValueStack stack)

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.