Adding content spots to a JSP
Adding a content spot to a JSP using the pre-packaged Content Spot class
- Open the Source page for your JSP.
- Add the following code to your JSP:
<jsp:useBean class="com.ibm.websphere.personalization.ContentSpot" id="spotName"/>
- Type the following in a new line immediately below it:
<% spotName.setContentSpotName("/YourCo/Products/Suggested Products Spot"); %> <% spotName.setRequest(request); %>where "Suggested Products Spot" is the same as the name you enter in the Personalization portlet user interface to reference this Content Spot, and "/YourCo/Products/" is the fully qualified folder structure where you located the Content Spot in the Personalization portlet user interface.
- The Content Spot names and paths can either be set by the page programmer and communicated to the user who configures Personalization in WebSphere® Portal, or they may be set first by the Personalization administrator and communicated to the page programmer. It is recommended that the business users work with the administrators and developers to decide on an standard organization for Personalization artifacts in the Personalization portlets.
Adding a generated content spot to a JSP
- Drag the content spot Java file from the Project Explorer and drop it onto the body of the JSP.
- Open the Source page for your JSP.
- Add the ID attribute to the useBean tag:
<jsp:useBean class="SpotClass" id="
spotName"/>
- Type the following in a new line immediately below it:
<%wherespotName.setRequest(request); %>
spotName is the same as the ID from the previous line.
The completed content spot should then appear as follows:
<jsp:useBean class="SpotClass" id="
spotName"/> <%
spotName.setRequest(request); %>
Related concepts
Creating and adding content spots to JSPs
Feedback