The jsp element executes a JSP page and sends output object values to the output ModelMap. JSPActors typically write to variables that are mapped by the JSPActor definition.

Note that existing JSP templates that were created with older versions of the ATG REST framework can be applied to JSPActors.

Note: If possible, use DropletActors instead of JSPActors, as DropletActors are more modular and do not require configuring a WAR file.

The jsp element contains the following:




This attribute defines the actor ID, and is used for actor ordering.


This is the absolute path of the JSP URL, excluding the context root.


The context root of the JSP URL.


The value that is written to the HTTP response by the JSP page. You can reference this attribute in an output element to add the response to the output model. This is useful for returning HTML snippets to render.


This element defines actors that must be executed prior to the execution of the current actor. There can be multiple depends elements associated with an actor.


This element defines actors that, if present, must be executed prior to the execution of the current actor. There can be multiple depends-if-present elements associated with an actor.


This element defines each actor’s input. Actors can have multiple input elements.


This element defines each actor’s output. Output elements create a map entry in a ModelMap. Actors can have multiple output elements.

The following is an example of a jsp element:

<actor-chain id="shippingMethods">
  <jsp url="/atg/commerce/pricing/shippingMethodsActor.jsp" context="DCS">
    <!-if true, getPrices will return prices with the shipping methods -->
    <input name="getPrices" value="${param.getPrices}">
    <output name="shippingMethods" value="${shippingMethods}"/>
    <output name="currencyCode" value="${currencyCode}"/>

The following is an example of the JSP that the element invokes:

  Return available shipping methods, optionally with prices
  Optional parameters:
   getPrices if true, will return prices with the shipping methods
  Model output:
  <dsp:importbean bean="/atg/commerce/pricing/AvailableShippingMethods" />
  <dsp:importbean bean="/atg/commerce/pricing/CurrencyCodeDroplet" />
  <dsp:importbean bean="/atg/commerce/order/purchase/ShippingGroupFormHandler" />
  <dsp:importbean bean="/atg/commerce/ShoppingCart" />
  <dsp:importbean bean="/atg/userprofiling/Profile" />

  <dsp:getvalueof var="shippingMethodsMap" class="java.core.util.HashMap"
  <dsp:getvalueof var="shippingGroup" bean="ShippingGroupFormHandler
      .firstNonGiftHardgoodShippingGroupWithRels" />
  <dsp:getvalueof var="getPrices" param="${param.getPrices}" />
  <dsp:droplet name="AvailableShippingMethods">
    <dsp:param name="shippingGroup" value="${shippingGroup}" />
    <dsp:oparam name="output">
      <dsp:getvalueof var="availableShippingMethods" vartype="java.lang.Object"
          param="availableShippingMethods" />
      <c:forEach var="availableShippingMethod"
        <c:set var="shippingPrice" value="null" />
        <c:if test="${getPrices == 'true'}">
          <%-Determine shipping price for the current shipping method --%>
          <dsp:droplet name="/atg/store/pricing/PriceShippingMethod"
            <dsp:param name="shippingMethod" value="${availableShippingMethod}" />
            <dsp:oparam name="output">
              <c:set target="${shippingMethodsMap}"
                  value="${priceShippingMethod.shippingPrice}" />
    <!-Sets property in the ActorContext -->
    <c:set name="shippingMethods" value="${shippingMethodsMap}" scope="request" />

  <%-Add the currencyCode if returning prices --%>
  <c:if test="${getPrices == 'true'}">
    <dsp:getvalueof var="priceListLocale" vartype="java.lang.String"
        bean="Profile.priceList.locale" />
    <dsp:droplet name="CurrencyCodeDroplet" var="currencyCodeDroplet">
      <dsp:param name="locale" value="${priceListLocale}" />
      <dsp:oparam name="output">
        <!-Sets property in the ActorContext -->
        <c:set name="currencyCode" value="${currencyCodeDroplet.currencyCode}"
            scope="request" />
Example: HTML Output

JSPActors can output HTML snippets to pass to the client using the response-var property. For example:

<jsp id="popup" page="/myapp/mypopup.jsp" context="myapp"
  <output id="popup" name="popup" value="${popupVar}"/>
Example: Migrating Previous REST JSP Templates

To apply previous versions of ATG REST JSP templates to the JSPActors:

<jsp id="displayCart" page="/orderDetail.jsp" context="mobile"
    response-var="orderJSON" >
  <output id="orderOut" name="order" value="${orderJSON}"

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices