com.opensymphony.webwork.components
Class Property
java.lang.Object
com.opensymphony.webwork.components.Component
com.opensymphony.webwork.components.Property
public class Property - extends Component
Used to get the property of a value, which will default to the top of
the stack if none is specified.
- default (String) - The default value to be used if value attribute is null
- escape (Boolean) - Escape HTML. Default to true
- value (Object) - value to be displayed
Example 1 prints the result of myBean's getMyBeanProperty() method.
Example 2 prints the result of myBean's getMyBeanProperty() method and if it is null, print 'a default value' instead.
<ww:property value="getText('some.key')" />
- Version:
- $Revision: 2468 $
- Author:
- Patrick Lightbody, Cameron Braid, Mathias Bogaert, tm_jee, Rene Gielen
|
Method Summary |
void |
setDefault(String defaultValue)
The default value to be used if value attribute is null |
void |
setEscape(boolean escape)
Whether to escape HTML |
void |
setValue(String value)
value to be displayed |
boolean |
start(Writer writer)
Callback for the start tag of this component. |
| Methods inherited from class com.opensymphony.webwork.components.Component |
addAllParameters, addParameter, altSyntax, copyParams, determineActionURL, determineNamespace, end, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setId, toString, usesBody |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Property
public Property(OgnlValueStack stack)
setDefault
public void setDefault(String defaultValue)
- The default value to be used if value attribute is null
setEscape
public void setEscape(boolean escape)
- Whether to escape HTML
setValue
public void setValue(String value)
- value to be displayed
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
|