The output element defines a map entry in a ModelMap. Once the actors are executed, the output values are evaluated and added to the ModelMap based on the name attribute.
The output element contains the following:
Attribute/Element | Description |
|---|---|
| Required. This attribute defines the actor ID, and is used for actor ordering. |
| Defines the name of the map entry. The value of this attribute can be static, or a dynamic EL expression. For additional information on |
| Defines the value of the map entry. The value of this attribute can be static, or a dynamic EL expression. For additional information on |
| Defines the bean filter that will be applied when the value object is filtered using the |
| Identifies if the value of the object should be embedded within the server response. For example, if the object is a JSON string, and it should be embedded in the JSON response, set the embedded mime attribute to |
| This attribute, when set to |
| This element defines actors that must be executed prior to the execution of the current actor. There can be multiple |
| This element defines actors that, if present, must be executed prior to the execution of the current actor. There can be multiple |
| The output tag supports internationalized messages that are added to the |
The following is an example of an output element:
<output name="globalInfo" value="${CSREnvironmentTools}"
filter-id="globalTemplate"/>The filter-id identifies the filter for the BeanFilterService to apply. Refer to the Bean Filtering section for further information.
The output tag supports localized message tags, which add internationalized messages to the ModelMap. By default, all messages are localized based upon the current user’s locale, however, the locale can be passed in using the message tag.
The message element contains the following:
Attribute/Element | Description |
|---|---|
| Required. This attribute defines the message ID. |
| The locale that will be used to localize the message, for example, |
| Identifies the resource bundle that contains the resource key. |
| The resource key identified by the resource bundle. |
| If message parameters are required during the resource lookup, you can use the attributes used by this element:
|
The following is an example of an output element with a message element. Messages are, by default, localized using the user’s locale, however, you can set the locale using the message tag:
<output id="error" name="error"
<message id="PRODUCT_NOT_IN_CURRENT_CATALOG"
bundle="atg.commerce.catalog.custom.UserResources
key="PRODUCT_NOT_IN_CURRENT_CATALOG">
<message-param id="arg0" value="${(productId != null) ?
productId : param.productId"/ >
</message>
</output>The output from the example above would be:
{"error": {
"messageCode" : "PRODUCT_NOT_IN_CURRENT_CATALOG",
"localizedMessage" : "Product xprod2099 is not defined in the current catalog"
}}
