Feature Pack 8WebSphere Commerce Version 7.0.0.9

Enabling interim fix JR56882

JR56882 provides the ability for custom command implementations and data beans to access the HttpServletRequest.

Before you begin

Install the interim fix for JR56882.

About this task

  • Set the 'UseHttpControllerRequestObject' option to true if you have existing custom command implementations and data beans that were written to use HttpControllerRequestObject. This option causes the WebSphere Commerce REST framework to construct a view command context with reference to an HttpControllerRequestObject when a REST resource method is mapped to a command or data bean. This behavior is similar to the WebSphere Commerce store runtime.
    Note: Even if this flag is not set to true, REST command mapping now constructs a command context where its GET Request/Response methods return the HttpServletRequest/Response.
  • Set the 'PropagateHttpServletRequest' option to true for custom command implementations that are mapped to a REST resource method through REST BOD mapping. This option causes the WebSphere Commerce REST framework to capture the HttpServletRequest/Response and propagate it to the WebSphere Commerce SOI framework. The propagation uses the transaction cache so that the WebSphere Commerce SOI framework can also construct command context with either direct references to the HttpServletRequest/Response or through HttpControllerRequestObject.

Procedure

  1. Open the custom foundation component configuration file (WCDE_installdir/workspace/WC/xml/config/com.ibm.commerce.foundation-ext/wc-component.xml).
    If a custom configuration file does not exist, then create one. For more information about how to create a custom configuration file, see Changing properties in the component configuration file.
    Note: The default component configuration file for the foundation component is WCDE_installdir/workspace/WC/xml/config/com.ibm.commerce.foundation/wc-component.xml.
  2. In your extended configuration, add the applicable properties to the REST configgroup.
    For example,
    <_config:configgrouping name="REST">
        <_config:property name="UseHttpControllerRequestObject" value="true"/>
        <_config:property name="PropagateHttpServletRequest" value="true"/>	
    </_config:configgrouping>
  3. Open the WCDE_installdir/workspace/WC/xml/config/com.ibm.commerce.foundation-ext/wc-business-context.xml file.
    If a custom configuration file does not exist, then create one. For more information about how to create a custom configuration file, see Changing properties in the component configuration file.
  4. Add the following configurations under /BusinessContexts/InitialBusinessContextSets.
    <InitialBusinessContextSet ctxSetId="Rest" >
        <InitialBusinessContext ctxId="BaseContext" createOrder="0" />
        <InitialBusinessContext ctxId="EntitlementContext" createOrder="1" />
        <InitialBusinessContext ctxId="GlobalizationContext" createOrder="1" />
        <InitialBusinessContext ctxId="AuditContext" createOrder="1" />
    </InitialBusinessContextSet>
  5. Save and close the extended configuration files.
  6. Test your configuration changes.
  7. Deploy your changes to the production environment.