Step 2: Creating URL references
In this step of the tutorial you will add URL references to the store in order to load new views for the catalog you created in the previous step.
To enable switching between sales catalogs within the same store implementation, URL references within the store need to be updated. This tutorial will update the CachedHeaderDisplay.jsp to allow for multiple sales catalogs.
When using JSTL, you will use the c:url reference tag. The c:url tag can include a number of parameters to make up a URL request that can be properly formatted to send to the WebSphere Commerce Server. The c:url tag's value will be the URL command name TopCategoriesDisplay. The identifier that is passed into this URL command will actually be the value you specified earlier for each Sales Catalog 'code', that is why it was important to make sure to type the code exactly as written in the tutorial in the previous step. The following three codes specify the three catalogs you created:
- ConsumerDirectSalesMain
- ConsumerDirectSalesHoliday
- ConsumerDirectSalesSpringFever
Follow these steps to create URL references to the new catalog views:
- Navigate to the following directory:
- WC_eardir/Stores.war/ConsumerDirect/include/styles/style1
- WCDE_installdir\workspace_dir\Stores\Web Content\ConsumerDirect\include\styles\style1
- Open the JSP header file called CachedHeaderDisplay.jsp, for editing
- Just before the first <tr> tag, copy and paste the following text:
<c:url var="IndexSalesURL" value="TopCategoriesDisplay"> <c:param name="langId" value="${langId}" /> <c:param name="storeId" value="${WCParam.storeId}" /> <c:param name="identifier" value="ConsumerDirectSalesMain" /> </c:url> <c:url var="IndexHolidayURL" value="TopCategoriesDisplay"> <c:param name="langId" value="${langId}" /> <c:param name="storeId" value="${WCParam.storeId}" /> <c:param name="identifier" value="ConsumerDirectSalesHoliday" /> </c:url> <c:url var="IndexSpringFeverURL" value="TopCategoriesDisplay"> <c:param name="langId" value="${langId}" /> <c:param name="storeId" value="${WCParam.storeId}" /> <c:param name="identifier" value="ConsumerDirectSalesSpringFever" /> </c:url>- Save and close CachedHeaderDisplay.jsp
You have now created the URL references necessary to link your new catalog views to the Consumer Direct starter store.
In the next step of the tutorial you will create the hypertext links that show up on the Consumer Direct starter store header so that users can view your catalogs.
(C) Copyright IBM Corporation 1996, 2006. All Rights Reserved.