Although it is best to explicitly define objects, the REST framework supports the ability to work with the following defined implicit objects:
Object | Description |
---|---|
| This object maps to the current request. |
| This object maps to the user’s session. |
| Maps a request parameter name to a single string value. |
| Maps a request parameter name to an array of string values. |
| Maps a request parameter name to an object value. |
| Maps a header name to a single string value. |
| Maps a header name to an array of string values. |
| Maps a cookie name to a cookie object. |
| Maps the current actor-chain’s |
| Maps a Nucleus component. |
Accessing Actor Context Variables
Actor context variables and attributes are available only for the duration of the actor-chain. Each nested actor-chain or child actor-chain is given a new ActorContext
and ModelMap
, and is unable to reference their parent’s ActorContext
and ModelMap
. However, all actor variables are added to the ActorContext
as attributes, which you can access.
To access ActorContext
, request or session attributes, you can map the attribute to a value using the ${order.id}
syntax or ${commerceItems[0]}
array notation.
For example, you could resolve a Nucleus component using the following EL expression:
${nucleus['/atg/commerce/ShoppingCart'].current}
If a variable name does not start one of the implicit objects listed in the Working with Implicit Objects section, the system will look up the variable in the attributes of the ActorContext
, then in the attributes of the request and finally in the attributes of the session. Note that you should have a separate actor context per actor-chain.
When working with a JSP page and JSPActors
, the JSP c:set
tag saves the variable in a request or session attribute. The attributes that are set using the c:set
tag are accessible in the actor definition and can be referenced in an output element to include in the ModelMap
.