JSP code snippet: e-Marketing Spot

This eMarketingSpotDisplay.jsp is built as a sample snippet to display an e-Marketing Spot in a store page.

This e-Marketing Spot code supports all types of campaign Web activity:

If you intend to display only one type of the campaign Web activity in your e-Marketing Spot, sections of the code that will not be used can be removed.

Prerequisites:

These two parameters are required by this code:

emsName

This file can be reused in different pages of the store by including it and giving a unique value for emsName, which should match exactly with an eMarketingSpot name that is defined in the WebSphere Commerce Accelerator.

catalogId

catalogId needs to be passed in as it is required to build the proper URL.

 

How to use this snippet?

This is an example of how this file could be included into a page:

 <c:import url="${jspStoreDir}include/eMarketingSpotDisplay.jsp">
 <c:param name="emsName" value="ShoppingCartPage" />
 <c:param name="catalogId" value="${WCParam.catalogId}" />
 </c:import>

In case special characters are used in the e-Marketing Spot name, and they need to be encoded in order to pass them successfully to this page through request parameter, the following technique may be used before setting the emsName parameter in the import statement:

request.setAttribute("emsName", java.net.URLEncoder.encode("ShoppingCartPage"));

And retrieve it from the request when setting the parameter:

<c:param name="emsName" value="${requestScope.emsName}"/>