Develop > Presentation layer > Work with JSP pages
Modifying existing JSPs files to interact with new JSP files
Once you add a new JSP to a storefront, modify other existing storefront pages to interact with the new file. This is accomplished by creating links from existing JSP files to the new JSP file.
Before you begin
- Create and register your new JSP file
- Determine on which pages to create links to the new JSP file.
- Defined any store text to use in the store text properties file.
Procedure
- Open WebSphere Commerce Developer
- In the Enterprise Explorer view, expand Stores > WebContent > storeName
- Continue to navigate to the subdirectory that contains the JSP file to modify.
- Add code similar to the following example to create a URL link. In this example the link connects to a registered view called RecipeSection.
<c:url var="RecipeSectionURL" value="RecipeSection"> <c:param name="langId" value="${langId}" /> <c:param name="storeId" value="${WCParam.storeId}" /> <c:param name="catalogId" value="${WCParam.catalogId}" /> <c:param name="categoryId" value="${topCategory.categoryId}" /> <c:param name="isRecipeSection" value="true" /> </c:url> <a href="<c:out value="${RecipeSectionURL}" />" class="m_link" id="WC_CachedHeaderDisplay_Link_10"><fmt:message key="ProjectsType" bundle="${storeText}" /></a>In the preceding example, five parameters are supplied to the new page. The "isRecipeSection" is an example of a custom parameter that can be used on the RecipeSection page.
- Test the the customization by navigating through the links you have created.