In the previous step of this tutorial, Converting a WebSphere Commerce JSP file to work with Commerce Enabled Portal, you converted the Emarketing.jsp file to work with Commerce Enabled Portal. In order for the e-Marketing Spot to display on the SubCategoriesDisplay.jsp file, we must add a parameter that gets the e-Marketing Spot in that file.
However, the SubCategoriesDisplay.jsp file is used by many portlets that compose the Winstons Commerce Enabled Portal starter store. In order to have the e-Marketing Spot display only on the Women's Fashion portlet, we will have to add some other logic to the SubCategoriesDisplay.jsp file.
To edit the SubCategoriesDisplay.jsp file to display the e-Marketing Spot, do the following:
- In the Project Navigator, find and open SubCategoriesDisplay.jsp. It is located in
- Stores\Web Content\Winstons\portal_jsp\ShoppingArea\CatalogSection\CategorySubsection
- Add the following parameter to SubCategoriesDisplay.jsp:
String sampleTest = jhelper.getParameter("testSample"); Add this parameter after the other String parameters.
- Find the following line:
<a href="<wcep:linkencoder>CategoryDisplay?catalogId=<%=catalogId%>&storeId=<%=storeId%> &categoryId=<%=parentCategory.getCategoryId()%>&langId=<%=languageId%>&top=Y </wcep:linkencoder>"><%=parentCategory.getDescription().getName()%></a> <hr noshade alsign="left">
</td>
</tr>
- After this line, you will add the logic that allows you to specify which portlet displays the e-Marketing Spot. Add the following logic:
<% if ((sampleTest!=null)&&(sampleTest.equals("true"))) {%>
<jsp:include page="Emarketing.jsp" flush="true">
<jsp:param name="emsName" value="sampleName" />
</jsp:include>
<%}%>
- Save your changes.
- Continue the tutorial by completing the steps in Creating an e-Marketing Spot in the WebSphere Commerce Accelerator.