Creating and registering a serialization JSP file for the customer segment attribute

Create and register a serialization JSP file to take the authoring elements from the MGPCONDELE table on the server and display them in the Management Center user interface. Business users can then set the properties for the customer segment attribute in the Marketing tool. The serialization JSP file is responsible for both the OR/AND list condition as well as the simple condition.


  1. Open HCL Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a directory to store your new JSP file.
    Use a directory structure similar to the following example:


  3. Create a JSP file with this syntax: SerializeCustomerSegmentattribute_name.jsp, for example, SerializeCustomerSegmentLoyaltyPoints.jsp.
  4. Define the new serialization JSP file.
    The following is a sample serialization JSP file:
    <%@ taglib uri="" prefix="c"%>
    <c:set var="objectType" value="LoyaltyPointsCondition"/> 
    <c:set var="parent" value="${}"/>
    <c:if test="${empty element.simpleConditionVariable}">
    	<c:set var="objectType" value="LoyaltyPointsList"/> 
    	<c:set var="parent" value="LoyaltyPoints"/> 
    	<c:forEach var="searchElement" items="${allElements}">
    		<c:if test="${ ==}">
    			<c:set var="foundChild" value="${searchElement}"/>
    		<c:when test="${element.conditionUsage == 'andListCondition'}"> 1
    			<c:set var="template" value="between"/>
    		<c:when test="${foundChild.simpleConditionOperator == '>='}"> 2
    			<c:set var="template" value="greaterThan"/>
    		<c:when test="${foundChild.simpleConditionOperator == '<='}"> 3
    			<c:set var="template" value="lessThan"/>
    			<c:set var="template" value="ignore"/>
    	<object objectType="${parent}">
    			<object objectId="${}"/>
    <object objectType="${objectType}">
    		<object objectId="${parent}"/>
    The following table describes the lines with black numbered callout labels.
    Option Description
    • If the condition usage is "andListCondition", the serialization JSP file will map to the <ObjectTemplate templateType="between"> template type, where the loyalty points condition has a range of values (minimum and maximum value).
    • If the condition operator is "<=", the serialization JSP file will map to the <ObjectTemplate templateType="lessThan"> template type, where the loyalty points condition has a single loyalty point value.
    • If the condition operator is ">=", the serialization JSP file will map to the <ObjectTemplate templateType="greaterThan"> template type, where the loyalty points condition has a single loyalty point value.

    To see other examples of serialization JSP files, review a default serialization JSP file for a similar customer segment attribute. The default files are named SerializeCustomerSegmentattribute_name.jsp, for example, SerializeCustomerSegmentCurrentAge.jsp. The default files are stored at this path:


  5. Save and close the new serialization JSP file.
  6. Open the Struts configuration file, struts-extension.xml.
    The file is stored at this path:


  7. Add a new action mapping to register the serialization JSP file:
    <action name="SerializeCustomerSegment-conditionVariable_value">
    <result name="SerializeCustomerSegment-conditionVariable_value">
    <param name="location">/jsp/your_company_name/marketing/name_of_serialization_jsp_file.jsp</param>


    • conditionVariable_value is the value of the objectType attribute defined in the object definition for this customer segment attribute
    • name_of_serialization_jsp_file is the name you gave to the custom serialization JSP file for your new customer segment attribute in an earlier step of this procedure.

    Here is an example:

    <action name="SerializeCustomerSegment-loyalty">
    <result name="SerializeCustomerSegment-loyalty">
    <param name="location">/jsp/your_company_name/marketing/SerializeCustomerSegmentLoyaltyPoints.jsp</param>
  8. Restart the HCL Commerce test server to make the new configuration available.