Feature Pack 5 or later

Modify Recipe JSP files to include SEO pattern information for constructing shorter and easier to read URLs

Introduced in Feature Pack 3 In this section, you update the wcf url tags in your recipe pages' JSP files to indicate a patternName parameter that indicates to the class constructor which URL pattern to use to construct SEO-friendly URLs.

About this task

For more information, see Overview of SEO friendly URL construction.

Procedure

  1. Navigate to Stores > WebContent > storedir > Widgets > Header > ext and open the following file:
    • Feature Pack 5Header_Data.jsp
    • Feature Pack 6 or laterHeader_Data.jspf
  2. Locate the following line of code:
    <wcf:url var="RecipeSectionURL" value="RecipeSection"> 
    Add the patternName parameter:
    <wcf:url var="RecipeProjectsURL" patternName="RecipeSectionDisplay" value="RecipeSection">
  3. Navigate to Stores > WebContent > storedir > Widgets > RecipeProjects
  4. Modify the Recipe JSP files to specify the appropriate pattern name in the URL construction:
    1. Open the RecipeProjects_Data.jsp file and locate the following code:
      <wcf:url var="RecipeCollectionURL" value="RecipeCollection">
      
      Replace with the following code:
      <wcf:url var="RecipeCollectionURL" patternName="RecipeCollectionDisplay" value="RecipeCollection">
    2. Ensure that the file contains the following code:
      <wcf:url var="RecipeDisplayURL" patternName="RecipeDisplayNoAssociation" value="RecipeDisplay"> 
      Note: If the file does not include the preceding code, locate this code:
      <wcf:url var="RecipeDisplayURL" value="RecipeDisplay">
      and replace it with the preceding code.
    3. Navigate to Stores > WebContent > storedir > Widgets > RecipeDetail
    4. Open RecipeDetail_Data.jsp and ensure that the file contains the following code:
      <wcf:url var="ProductDisplayURL" patternName="ProductURL" value="Product1"> 
      Note: If the file does not include the preceding code, locate this code:
      <wcf:url var="ProductDisplayURL" value="Product1"> 
      and replace it with the preceding code.
    5. Navigate to Stores > WebContent > storedir > Widgets > RecipeCollection
    6. Open RecipeCollection_Data.jsp and ensure that the file contains the following code:
      <wcf:url var="RecipeDisplayURL" patternName="RecipeDisplay" value="RecipeDisplay" >
      Note: If the file does not include the preceding code, locate this code:
      <wcf:url var="RecipeDisplayURL" value="RecipeDisplay" >
      and replace it with the preceding code.
  5. Restart the WebSphere Commerce server to load the new recipe pattern files.