Creating and registering new storefront JavaServer Pages files

In this lesson, you will create new JavaServer Pages (JSP) files to display a new Recipes section in the storefront.

About this task

The following JSP files are created:

RecipeSection.jsp
This JSP file is the page displayed when a user clicks on the Recipes link from anywhere within the store. It contains links to all the Recipe Collections, as well as to Recipes that do not belong to a Collection. Recipe Collections link to the RecipeCollection.jsp file, and Recipes that do not belong to a Collection link to the RecipeDisplay.jsp file.
RecipeCollection.jsp
This JSP file contains links to the Recipes that are in a Recipe Collection. At most, 10 Recipes are displayed at a time, with back and forward navigation links to go to the previous or next 10 recipes. Each link goes to the RecipeDisplay.jsp file.
RecipeDisplay.jsp
This JSP file displays information such as name, description, materials, and instructions for a Recipe.
RecipeList.jsp
This JSP file outputs a list of recipes that utilize a given product. In the next lesson, you will modify product display pages to use this JSP file.

Procedure

  1. Extend the storefront properties file.

    Properties files limit the amount of static information contained in JSP files. A limited amount of static information simplifies multi-language support and modification. A properties file defines values for language sensitive strings.

    1. In the Enterprise Explorer view, navigate to Stores . Right-click the Stores folder and select Refresh.
    2. In the Enterprise Explorer view, expand Stores > Java Resources: src > ConsumerDirectStorefrontAssetStore.
    3. Open the storetext.properties file.
    4. Add the following to the bottom of the file; then save the file.
       #Project Properties
      ProjectCollectionsType = Recipe Collections
      ProjectCollectionIntro = Collections convieniently group together similar recipes.
      NoProjects = There are no Recipes or Recipe Collections available.
      ProjectsType = Recipes
      UnassignedProjects = The following recipes do not belong to any collection:
      EmptyCollection = This Collection contains no recipes.
      NextCollections = More...
      PreviousCollections = Previous...
      ProjectTime = Time:
      ProjectDifficulty = Difficulty Level:
      ProjectDescription = Description:
      ProjectMaterials = Ingredients
      MaterialsIdentifier = Name
      MaterialsAmount = Amount
      MaterialsAmountUnit = Unit of Measure
      MaterialsDescription = Description
      MaterialsNotSold = (not sold in store)
      ProjectToolsIntro = This recipe also uses the following tools:
      ProjectInstructions = Instructions
      InstructionIsOptional = (Optional step)  
      Note: To use a property key=value within a JSP file, use the following tag
      <fmt:message key="key" bundle="${storeText}"/>
  2. Create the RecipeSection.jsp file:
    1. In the Enterprise Explorer view, expand Stores > WebContent > ConsumerDirectStorefrontAssetStore > ShoppingArea. .
    2. Right-click the ShoppingArea; then select New > Folder.
    3. In the Folder name field, enter RecipeSection; then click Finish.
    4. If the RecipeSection folder is not visible, right-click the ShoppingArea directory in the Enterprise Explorer view and click Refresh.
    5. Right-click the RecipeSection folder; then select New > JSP. If you cannot see JSP, select Others. In the Select a Wizard page, select Show All Wizards and select Web > JSP.
    6. In the File name field, enter RecipeSection and click Finish. The newly created RecipeSection.jsp automatically opens.
    7. Paste the following code into the RecipeSection.jsp file, overwriting the automatically generated code.
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
      <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %>
      <%@ taglib uri="flow.tld" prefix="flow" %>
      <%@ include file="../../include/JSTLEnvironmentSetup.jspf"%>
      <html>
      <title><fmt:message key="ProjectCollectionsType" bundle="${storeText}"/></title>
      <head>
      <link rel="stylesheet" href="<c:out value="${jspStoreImgDir}${vfileStylesheet}"/>" type="text/css"/>
      </head>
      <body>
      <%@ include file="../../include/LayoutContainerTop.jspf"%>
      
      <!-- This getData tag retrieves a list of all Collections associated with the current store. -->
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectCollectionType[]"
         var="collections"
         expressionBuilder="getAllCollections"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
      </wcf:getData>
      
      <!-- This getData tag retrieves a list of all Projects in the current store which are not
      associated with a collection. -->
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="unassignedProjects"
         expressionBuilder="getUnassignedProjects"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
      </wcf:getData>
      
      <!--  Display the list of Collections. -->
      <font size="3"><fmt:message key="ProjectCollectionsType" bundle="${storeText}"/></font>
      <c:if test="${!empty collections}">
      <p><fmt:message key="ProjectCollectionIntro" bundle="${storeText}"/></p>
      <ul>
      <c:forEach var="collection" items="${collections}">
         <c:url var="RecipeCollectionURL" value="RecipeCollection">
             <c:param name="recordSetStartNumber" value="0"/>
             <c:param name="collection" value="${collection.projectCollectionIdentifier.uniqueID}" />
             <c:param name="langId" value="${WCParam.langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
             <c:param name="collectionName" value="${collection.projectCollectionIdentifier.externalIdentifier.name}"/>
         </c:url>
         <li><a href="<c:out value="${RecipeCollectionURL}"/>" ><c:out value="${collection.projectCollectionIdentifier.externalIdentifier.name}" escapeXml="false"/></a>
      </c:forEach>
      </ul>
      </c:if>
      
      <!-- Display the list of Projects which do not belong to a Collection. -->
      <c:if test="${!empty unassignedProjects}">
      <p><fmt:message key="UnassignedProjects" bundle="${storeText}"/></p>
      <ul>
      <c:forEach var="project" items="${unassignedProjects}">
         <c:url var="RecipeDisplayURL" value="RecipeDisplay">
             <c:param name="project" value="${project.projectIdentifier.uniqueID}" />
             <c:param name="langId" value="${WCParam.langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
         </c:url>
         <li><a href="<c:out value="${RecipeDisplayURL}" />" ><c:out value="${project.projectIdentifier.externalIdentifier.name}" escapeXml="false"/></a>
      </c:forEach>
      </ul>
      </c:if>
      <c:if test="${empty unassignedProjects && empty collections}">
         <fmt:message key="NoProjects" bundle="${storeText}"/>
      </c:if>
      <%@ include file="../../include/LayoutContainerBottom.jspf"%>
      </body>
      </html> 
      

      Note the structure of the getData tags in this JSP file:

      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectCollectionType[]"
         var="collections"
         expressionBuilder="getAllCollections"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
      </wcf:getData>  
       
      

      This tag returns a list of ProjectCollections that are assigned to the collections variable. The Project Collections returned are determined by expression builder, getAllCollections, that you created in the get-data-config file in the previous lesson. The query template to which expression builder getAllCollections forwards the request also requires the store identifier to process the query. This information is passed using the <wcf:contextData> tag. Finally varShowVerb contains information about the result of this query, such as the number of results returned.

      The second getData tag follows the same general format:

      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="unassignedProjects"
         expressionBuilder="getUnassignedProjects"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
      </wcf:getData>
      

      This tag returns a list of Projects that are assigned to the unassignedProjects variable. The projects returned are determined by the expression builder, getUnassignedProjects.

  3. Create the RecipeCollection.jsp file:
    1. In the Enterprise Explorer view, expand Stores > WebContent > ConsumerDirectStorefrontAssetStore > ShoppingArea > RecipeSection.
    2. Right-click the RecipeSection folder and select New > JSP File.
    3. In the File name field, enter RecipeCollection and click Finish. The newly created RecipeCollection.jsp automatically opens.
    4. Paste the following code into the RecipeCollection.jsp file, overwriting the automatically generated code.
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
      <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %>
      <%@ taglib uri="flow.tld" prefix="flow" %>
      <%@ include file="../../include/JSTLEnvironmentSetup.jspf"%>
      <html>
      <title>${param.collectionName}</title>
      <head>
      <link rel="stylesheet" href="<c:out value="${jspStoreImgDir}${vfileStylesheet}"/>" type="text/css"/>
      </head>
      <body>
      <%@ include file="../../include/LayoutContainerTop.jspf"%>
      
      <!-- This getData tag retrieves 10 Projects from the Collection at a time. -->
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="projects"
         expressionBuilder="getProjectsByCollection"
         maxItems="10"
         recordSetReferenceId="${param.recordSetReferenceId}"
         recordSetStartNumber="${param.recordSetStartNumber}"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
         <wcf:param name="collectionID" value="${param.collection}"/>
      </wcf:getData>
      
      <!-- Display the Projects in this Collection. -->
      <c:choose>
         <c:when test="${(empty projects)}">
             <fmt:message key="EmptyCollection" bundle="${storeText}"/>
         </c:when>
         <c:otherwise>
             <font size="3">${param.collectionName}</font>
             <ul>
             <c:forEach var="project" items="${projects}">
                         <c:url var="RecipeDisplayURL" value="RecipeDisplay">
                             <c:param name="project" value="${project.projectIdentifier.uniqueID}" />
                             <c:param name="langId" value="${langId}" />
                             <c:param name="storeId" value="${WCParam.storeId}" />
                             <c:param name="catalogId" value="${WCParam.catalogId}" />
                         </c:url>
                         <li><a href="<c:out value="${RecipeDisplayURL}" />" ><c:out value="${project.projectIdentifier.externalIdentifier.name}" escapeXml="false"/></a>
             </c:forEach>
             </ul>
         </c:otherwise>
      </c:choose>
      
      <!-- Link to a page of the next 10 and previous 10 Projects in this Collection. -->
      <c:if test="${showVerb.recordSetTotal > param.recordSetStartNumber + 10}">
         <c:url var="RecipeCollectionURL" value="RecipeCollection">
             <c:param name="recordSetStartNumber" value="${param.recordSetStartNumber + 10}"/>
             <c:param name="collection" value="${param.collection}" />
             <c:param name="langId" value="${langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
             <c:param name="collectionName" value="${param.collectionName}"/>
             <c:param name="recordSetReferenceId" value="${showVerb.recordSetReferenceId}"/>
         </c:url>
         <br/>
         <a href="<c:out value="${RecipeCollectionURL}" />" ><fmt:message key="NextCollections" bundle="${storeText}"/></a>
      </c:if>
      <c:if test="${param.recordSetStartNumber > 0}">
         <c:url var="RecipeCollectionURL" value="RecipeCollection">
             <c:param name="recordSetStartNumber" value="${param.recordSetStartNumber - 10}"/>
             <c:param name="collection" value="${param.collection}" />
             <c:param name="langId" value="${langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
             <c:param name="collectionName" value="${param.collectionName}"/>
             <c:param name="recordSetReferenceId" value="${showVerb.recordSetReferenceId}"/>
         </c:url>
         <br/>
         <a href="<c:out value="${RecipeCollectionURL}" />" ><fmt:message key="PreviousCollections" bundle="${storeText}"/></a>
      </c:if>
      <%@ include file="../../include/LayoutContainerBottom.jspf"%>
      </body>
      </html> 
      

      Note the differences in the getData tag in the RecipeCollection.jsp file:

      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="projects"
         expressionBuilder="getProjectsByCollection"
         maxItems="10"
         recordSetReferenceId="${param.recordSetReferenceId}"
         recordSetStartNumber="${param.recordSetStartNumber}"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
         <wcf:param name="collectionID" value="${param.collection}"/>
      </wcf:getData>  

      This tag returns a list of Projects that belong to a given Collection. The projects returned are determined by the expression builder, getProjectsByCollection. However, the collection ID from which to retrieve projects must be passed to the expression builder, and this is done using the <wcf:param> tag. Additionally, you want to only display 10 recipes at a time. You limit the number of returned items by setting the parameter maxItems="10", and return items starting from the index defined by recordSetStartNumber. Later in the JSP file, when you link to the next 10 recipes in this collection, if they exist, you increment recordSetStartNumber by 10. recordSetReferenceId is a reference to this query in the cache and is passed when linking to the next 10 recipes as well.

  4. Create the RecipeDisplay.jsp file:
    1. In the Enterprise Explorer view, expand Stores > WebContent > ConsumerDirectStorefrontAssetStore > ShoppingArea > RecipeSection.
    2. Right-click the RecipeSection folder and select New > JSP.
    3. In the File name field, enter RecipeDisplay and click Finish. The newly created RecipeDisplay.jsp file automatically opens.
    4. Paste the following code into the RecipeDisplay.jsp file, overwriting the automatically generated code.
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
      <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %>
      <%@ taglib uri="flow.tld" prefix="flow" %>
      <%@ include file="../../include/JSTLEnvironmentSetup.jspf"%>
      
      <!-- This getData tag retrieves the project information for a given Project. -->
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType"
         var="project"
         expressionBuilder="getProjectsByID"
         varShowVerb="showVerb">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
         <wcf:contextData name="langId" data="${WCParam.langId}"/>
         <wcf:param name="projectID" value="${param.project}"/>
      </wcf:getData>
      
      <html>
      <title>${project.projectIdentifier.externalIdentifier.name}</title>
      <head>
      <link rel="stylesheet" href="<c:out value="${jspStoreImgDir}${vfileStylesheet}"/>" type="text/css"/>
      </head>
      <%@ include file="../../include/LayoutContainerTop.jspf"%>
      
      <!-- Display the returned Project's information in a table. -->
      <font size="3">${project.projectIdentifier.externalIdentifier.name}</font>
      <table border="1">
      <tr>
         <td colspan=2><fmt:message key="ProjectTime" bundle="${storeText}"/> ${project.timeToComplete}</td>
         <td colspan=2><fmt:message key="ProjectDifficulty" bundle="${storeText}"/> ${project.difficulty}</td>
      </tr>
      <tr>
         <td colspan=4><fmt:message key="ProjectDescription" bundle="${storeText}"/><br/></t>${project.description[0].shortDescription}
         <br/></t>${project.description[0].longDescription}</td>
      </tr>
      <tr>
         <td colspan=4><fmt:message key="ProjectMaterials" bundle="${storeText}"/></td>
      </tr>
      <tr>
         <td><fmt:message key="MaterialsIdentifier" bundle="${storeText}"/></td>
         <td><fmt:message key="MaterialsAmount" bundle="${storeText}"/></td>
         <td><fmt:message key="MaterialsAmountUnit" bundle="${storeText}"/></td>
         <td><fmt:message key="MaterialsDescription" bundle="${storeText}"/></td>
      </tr>
      <c:forEach var="material" items="${project.material}">
      <tr>
         <td>
         <c:choose>
         <c:when test="${empty material.catalogEntry.catalogEntryIdentifier.uniqueID}" >
             ${material.projectMaterialIdentifier.externalIdentifier.name} <fmt:message key="MaterialsNotSold" bundle="${storeText}"/>
         </c:when>
         <c:otherwise>
             <c:url var="ProductDisplayURL" value="ProductDisplay">
                 <c:param name="langId" value="${langId}" />
                 <c:param name="storeId" value="${WCParam.storeId}" />
                 <c:param name="catalogId" value="${WCParam.catalogId}" />
                 <c:param name="productId" value="${material.catalogEntry.catalogEntryIdentifier.uniqueID}" />
             </c:url>
             <a href="<c:out value="${ProductDisplayURL}" />" ><c:out value="${material.catalogEntry.displayName.value}" escapeXml="false"/></a>
         </c:otherwise>
         </c:choose>
         </td>
         <td>${material.amount.value}</td>
         <td>${material.amount.uom}</td>
         <td>${material.projectMaterialDescription[0].value}</td>
      </tr>
      </c:forEach>
      <tr>
         <td colspan=4><fmt:message key="ProjectToolsIntro" bundle="${storeText}"/>
         <ul>
         <c:forEach var="tool" items="${project.tool}">
             <c:url var="ProductDisplayURL" value="ProductDisplay">
                 <c:param name="langId" value="${langId}" />
                 <c:param name="storeId" value="${WCParam.storeId}" />
                 <c:param name="catalogId" value="${WCParam.catalogId}" />
                 <c:param name="productId" value="${tool.catalogEntryIdentifier.uniqueID}" />
             </c:url>
             <li><a href="<c:out value="${ProductDisplayURL}" />" ><c:out value="${tool.displayName.value}" escapeXml="false"/></a>
         </c:forEach>
         </ul>
         </td>
      </tr>
      <tr>
      <td colspan=4><fmt:message key="ProjectInstructions" bundle="${storeText}"/><ul>
      <c:forEach var="instruction" items="${project.instruction}">
         <li>
         <c:if test="${instruction.optional}">
             <fmt:message key="InstructionIsOptional" bundle="${storeText}"/>
         </c:if>
         ${instruction.projectInstructionDescription[0].value}
      </c:forEach>
      </ul>
      </td>
      </tr>
      </table>
      <%@ include file="../../include/LayoutContainerBottom.jspf"%>
      </body>
      </html> 
      
      Note: The type attribute of the getData tag is type="com.mycompany.commerce.project.facade.datatypes.ProjectType". This returns the first item matched rather than a list specified by ProjectType[] .
  5. Create the RecipeList.jsp file:
    1. In the Enterprise Explorer view, expand Stores > WebContent > ConsumerDirectStorefrontAssetStore > ShoppingArea > RecipeSection.
    2. Right-click the RecipeSection folder and select New > JSP File.
    3. In the File name field, enter RecipeList and click Finish. The newly created RecipeList.jsp automatically opens.
    4. Paste the following code into RecipeList.jsp, overwriting the automatically generated code.
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
      <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %>
      <%@ taglib uri="flow.tld" prefix="flow" %>
      
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="usedAsToolBy"
         expressionBuilder="getProjectsUsingAsTool"
         varShowVerb="showVerbTool">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
         <wcf:contextData name="langId" data="${WCParam.langId}"/>
         <wcf:param name="catEntryId" value="${param.productId}"/>
      </wcf:getData>
      
      <wcf:getData type="com.mycompany.commerce.project.facade.datatypes.ProjectType[]"
         var="usedAsMaterialBy"
         expressionBuilder="getProjectsUsingAsMaterial"
         varShowVerb="showVerbMaterial">
         <wcf:contextData name="storeId" data="${WCParam.storeId}"/>
         <wcf:contextData name="langId" data="${WCParam.langId}"/>
         <wcf:param name="catEntryId" value="${param.productId}"/>
      </wcf:getData>
      
      <c:if test="${!empty usedAsToolBy || !empty usedAsMaterialBy}">
      <br/>This product is used in the following recipes: <ul>
      <c:forEach var="projectTool" items="${usedAsToolBy}">
         <c:url var="RecipeDisplayURL" value="RecipeDisplay">
             <c:param name="project" value="${projectTool.projectIdentifier.uniqueID}" />
             <c:param name="langId" value="${WCParam.langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
         </c:url>
         
         <li><a href="<c:out value="${RecipeDisplayURL}" />" ><c:out value="${projectTool.projectIdentifier.externalIdentifier.name}" escapeXml="false"/></a>
         <br/>
      </c:forEach>
      
      <c:forEach var="projectMaterial" items="${usedAsMaterialBy}">
         <c:url var="RecipeDisplayURL" value="RecipeDisplay">
             <c:param name="project" value="${projectMaterial.projectIdentifier.uniqueID}" />
             <c:param name="langId" value="${WCParam.langId}" />
             <c:param name="storeId" value="${WCParam.storeId}" />
             <c:param name="catalogId" value="${WCParam.catalogId}" />
         </c:url>
         
         <li><a href="<c:out value="${RecipeDisplayURL}" />" ><c:out value="${projectMaterial.projectIdentifier.externalIdentifier.name}" escapeXml="false"/></a>
         <br/>
      </c:forEach>
      </ul>
      </c:if>
      
  6. Register the new JSP files in the Struts configuration file

    The four new JSP files must be registered in the Struts config file to be recognized by the WebSphere Commerce Web services framework. Modifying the Struts configuration associates the new views with the actual JSP files.

    1. In the Enterprise Explorer view, expand Stores > WebContent > WEB-INF.
    2. Open the struts-config-ext.xml file.
    3. Add the following in the global forward section, which is found at the beginning of the file.
      Replace the value 10703 with your own store ID. If you do not know your store ID, run the following SQL query to determine the ID:
      
      select * from storeent;
      
      <forward className="com.ibm.commerce.struts.ECActionForward" name="RecipeSection/10703" path="/ShoppingArea/RecipeSection/RecipeSection.jsp"/>
      <forward className="com.ibm.commerce.struts.ECActionForward" name="RecipeCollection/10703" path="/ShoppingArea/RecipeSection/RecipeCollection.jsp"/>
      <forward className="com.ibm.commerce.struts.ECActionForward" name="RecipeList/10703" path="/ShoppingArea/RecipeSection/RecipeList.jsp"/>
      <forward className="com.ibm.commerce.struts.ECActionForward" name="RecipeDisplay/10703" path="/ShoppingArea/RecipeSection/RecipeDisplay.jsp"/>
      
      Note: 10703 is the database storeent_id of ConsumerDirectStorefrontAssetStore, to which these JSP files are registered. Your store inherits these commands from the asset store because created stores have no JSP files of their own.
    4. Add following in the action mappings section, which is found at the end of the file.

      Replace the value 10703 with your own store ID.

      <action path="/RecipeSection" type="com.ibm.commerce.struts.BaseAction">
      <set-property property="https" value="10703:1"/>
      </action>
      <action path="/RecipeCollection" type="com.ibm.commerce.struts.BaseAction">
      <set-property property="https" value="10703:1"/>
      </action>
      <action path="/RecipeList" type="com.ibm.commerce.struts.BaseAction">
      <set-property property="https" value="10703:1"/>
      </action>
      <action path="/RecipeDisplay" type="com.ibm.commerce.struts.BaseAction">
      <set-property property="https" value="10703:1"/>
      </action>
      
  7. Create access control policies for the new JSP files.

    By default, only site administrators can access new views. Create access control policies for each view to allow general access to the JSP files that you created.

    1. Stop the WebSphere Commerce Server, if it is running.
    2. Create a file called RecipeSectionCommand.xml under the directory WCDE_installDir\xml\policies\xml.
    3. Paste the following into the RecipeSectionCommand.xml file and save it:
      <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
      <!DOCTYPE Policies SYSTEM "../dtd/accesscontrolpolicies.dtd">
      
      <Policies>
      
      <Action Name="RecipeSection" CommandName="RecipeSection">
      </Action>
      <ActionGroup Name="AllSiteUsersViews" OwnerID="RootOrganization">
      <ActionGroupAction Name="RecipeSection"/>
      </ActionGroup>
      
      </Policies>
      
    4. At the command prompt, navigate to WCDE_installdir\bin.
    5. Run the following command:
      • acpload RecipeSectionCommand.xml
      • DB2acpload db_name db_user db_password RecipeSectionCommand.xml db_schema
    6. Create a file called RecipeCollectionCommand.xml under the directory WC_eardir\xml\policies\xml.
    7. Paste the following into the RecipeCollectionCommand.xml file, and save it:
      <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
      <!DOCTYPE Policies SYSTEM "../dtd/accesscontrolpolicies.dtd">
      
      <Policies>
      
      <Action Name="RecipeCollection" CommandName="RecipeCollection">
      </Action>
      <ActionGroup Name="AllSiteUsersViews" OwnerID="RootOrganization">
      <ActionGroupAction Name="RecipeCollection"/>
      </ActionGroup>
      
      </Policies>
      
    8. At the command prompt, navigate to WCDE_installdir\bin.
    9. Run the following command:
      • acpload RecipeCollectionCommand.xml
      • DB2acpload db_name db_user db_password RecipeCollectionCommand.xml db_schema
    10. Create a file called RecipeDisplayCommand.xml under the directory WC_eardir\xml\policies\xml.
    11. Paste the following into the RecipeDisplayCommand.xml file and save it:
      <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
      <!DOCTYPE Policies SYSTEM "../dtd/accesscontrolpolicies.dtd">
      
      <Policies>
      
      <Action Name="RecipeDisplay" CommandName="RecipeDisplay">
      </Action>
      <ActionGroup Name="AllSiteUsersViews" OwnerID="RootOrganization">
      <ActionGroupAction Name="RecipeDisplay"/>
      </ActionGroup>
      
      </Policies>
      
    12. At the command prompt, navigate to WCDE_installdir\bin.
    13. Run the following command:
      • acpload RecipeDisplayCommand.xml
      • DB2acpload db_name db_user db_password RecipeDisplayCommand.xml db_schema
    14. Create a file called RecipeListCommand.xml under the directory WC_eardir\xml\policies\xml.
    15. Paste the following into the RecipeListCommand.xml file and save it:
      <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
      <!DOCTYPE Policies SYSTEM "../dtd/accesscontrolpolicies.dtd">
      
      <Policies>
      
      <Action Name="RecipeList" CommandName="RecipeList">
      </Action>
      <ActionGroup Name="AllSiteUsersViews" OwnerID="RootOrganization">
      <ActionGroupAction Name="RecipeList"/>
      </ActionGroup>
      
      </Policies>
      
    16. At the command prompt, navigate to WCDE_installdir\bin.
    17. Run the following command:
      • acpload RecipeListCommand.xml
      • DB2acpload db_name db_user db_password RecipeListCommand.xml db_schema