Step 4: Editing a Commerce Enabled Portal JSP file

In the previous step of the tutorial (Understanding the tags used in Commerce Enabled Portal JSP files), you learned about the tags used in Commerce Enabled Portal JSP files.

In this step of the tutorial you will edit a Commerce Enabled Portal JSP file and view the corresponding change in the Commerce Enabled Portal development environment.

You will add a link to the high level categories of Women's Fashion in the Women's Fashion section on the Fashion page of the consumer direct Commerce Enabled Portal starter store. When adding this link you will also use the Commerce Enabled Portal tags discussed in the previous step of the tutorial.

To add the link, do the following:

  1. In the SubCategoriesDisplay.jsp page find parentCategory.getDescription(). Currently this bean is only finding and displaying the name of the parent category - Women's Fashion, as you saw when you viewed the starter store in the first step of this tutorial.
  2. You will make this name into a link to the Women's Fashion high level categories page. To make a link, use the Category display URL command.
    <a href=CategoryDisplay?catalogId=<%=catalogId%>&storeId=<%=storeId%>&categoryId
    =<%=parentCategory.getCategoryId()%>&langId=<%=languageId%>&top=Y
    <%=top_category%><%=parentCategory.getDescription().getName()%></a>
    However, since this if for a Commerce Enabled Portal JSP, you need to add the wcep: linkencoder tag to it
    <a href="<wcep:linkencoder>CategoryDisplay?catalogId=<%=catalogId%>&storeId=<%=storeId%>&categoryId
    =<%=parentCategory.getCategoryId()%>&langId=<%=languageId%>&top=Y
    </wcep:linkencoder>"><%=parentCategory.getDescription().getName()%></a>
    
  3. Save your changes.
  4. View your changes. You will need to refresh the project and Run on Server again. See Viewing the Commerce Enabled Portal starter store in the Commerce Enabled Portal development environment.
  5. Women's Fashion should now have a link in the heading. Click Fashion. The high level categories for Women's Fashion display.

Congratulations! You have now completed the tutorial.


Feedback