Labelpublic class Label extends UIBean
Renders an HTML LABEL that will allow you to output label:name combination that has the same format treatment as
the rest of your UI controls.
Examples
In this example, a label is rendered. The label is retrieved from a ResourceBundle via the key attribute
giving you an output of 'User Name: Ford.Prefect'. Assuming that i18n message userName corresponds
to 'User Name' and the action's getUserName() method returns 'Ford.Prefect'
<s:label key="userName" />
<s:label name="userName" label="User Name" />
|
Fields Summary |
---|
public static final String | TEMPLATE | protected String | forAttr |
Methods Summary |
---|
protected void | evaluateExtraParams()
super.evaluateExtraParams();
if (forAttr != null) {
addParameter("for", findString(forAttr));
}
// try value first, then name (this overrides the default behavior in the superclass)
if (value != null) {
addParameter("nameValue", findString(value));
} else if (name != null) {
String expr = name;
if (altSyntax()) {
expr = "%{" + expr + "}";
}
addParameter("nameValue", findString(expr));
}
| protected java.lang.String | getDefaultTemplate()
return TEMPLATE;
| public void | setFor(java.lang.String forAttr)
this.forAttr = forAttr;
|
|