Adding content spots to a JSP
Adding a content spot to a JSP using the pre-packaged Content Spot class
- Drag the content spot class file from the left frame of Rational Application Developer onto the body of the JSP. The Attributes window will open
- Click OK to close the Attributes window.
- Open the Source page for your JSP.
- Locate the code for the content spot. It will appear similar to: <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 spotName is the same as the ID from the previous line, "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 class file from the left frame of Rational Application Developer onto the body of the JSP. The Attributes window will open.
- Click OK to close the Attributes window.
- Open the Source page for your JSP.
- Locate the code for the content spot. It will appear similar to:
<jsp:useBean class="SpotClass" id="spotName"/>- Type the following in a new line immediately below it:
<% spotName.setRequest(request); %>where 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); %>
Back