Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.components
Class Property

    java.lang.Object
      org.apache.struts2.components.Component
          org.apache.struts2.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

         TextUtils

     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.

     <s:property value="getText('some.key')" />

Field Summary

Fields inherited from class org.apache.struts2.components.Component
`actionMapper, COMPONENT_STACK, devMode, parameters, stack, standardAttributesMap, throwExceptionOnELFailure`

Constructor Summary
`Property(ValueStack stack)`

Method Summary
`void` | `setDefault(String defaultValue)`
`void` | `setDefaultValue(String defaultValue)`
`void` | `setEscape(boolean escape)`
`void` | `setEscapeCsv(boolean escapeCsv)`
`void` | `setEscapeHtml(boolean escape)`
`void` | `setEscapeJavaScript(boolean escapeJavaScript)`
`void` | `setEscapeXml(boolean escapeXml)`
`void` | `setValue(String value)`
`boolean` | `start(Writer writer)` Callback for the start tag of this component.

Methods inherited from class org.apache.struts2.components.Component
`addAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, copyParams, determineActionURL, determineNamespace, end, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, getStandardAttributes, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString, usesBody`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Property

    public Property(ValueStack stack)

Method Detail

### setDefault

    public void setDefault(String defaultValue)

### setEscape

    public void setEscape(boolean escape)

### setEscapeHtml

    public void setEscapeHtml(boolean escape)

### setEscapeJavaScript

    public void setEscapeJavaScript(boolean escapeJavaScript)

### setValue

    public void setValue(String value)

### setDefaultValue

    public void setDefaultValue(String defaultValue)

### setEscapeCsv

    public void setEscapeCsv(boolean escapeCsv)

### setEscapeXml

    public void setEscapeXml(boolean escapeXml)

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.