...
The Action instance is always pushed onto the value stack. Because the Action is on the stack, and the stack is the OGNL root, references to Action properties can omit the #
marker. But, to access other objects in the ActionContext, we must use the #
notation so OGNL knows not to look in the root object, but for some other object in the ActionContext.
Code Block | |||||||
---|---|---|---|---|---|---|---|
| |||||||
<s:property value="postalCode"/> |
Other (non-root) objects in the ActionContext can be rendered use the #
notation.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<s:property value="#session.mySessionPropKey"/> or <s:property value="#session['mySessionPropKey']"/> or <s:property value="#request['myRequestPropKey']"/> |
...
To select a subset of a collection (called projection), use a wildcard within the collection.
- ? - All elements matching the selection logic
- ^ - Only the first element matching the selection logic
- $ - Only the last element matching the selection logic
To obtain a subset of just male relatives from the object person:
...