Troubleshooting: Dynamic caching in an application

WebSphere Commerce uses the JSTL (Java Server Tag Library) to create new JSP pages. This enables a Web developer to create a Java page without having to worry about the underlying code, while a Java developer can write the code simultaneously, or at a later period. Unfortunately, dynamic caching cannot execute the JSTL <c:import> tag on its own.

If you are using JSTL for your store pages and want to use dynamic caching to cache your pages:

  1. Open your JSP file.
  2. Create an out.flush() around the <c:import> tag in your JSP file. This is shown in the following example:
    
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <% out.flush(); %>
    <c:import
    url="${jspStoreDir}${StyleDir}CachedHeaderDisplay.jsp">
            <c:param name="storeId" value="${WCParam.storeId}"/>
            <c:param name="catalogId"
    value="${WCParam.catalogId}"/>
                    <c:param name="langId" value="${langId}"/>
            <c:param name="categoryId" value="${categoryId}"/>
            <c:param name="userType" value="${userType}"/>
            <c:param name="lastCmdName" value="${lastCmdName}"/>
    </c:import>
    <% out.flush(); %>
    
    
     
    

You should now be able to use dynamic caching.

Tip: It is not required to use out.flush statements, however, the pages may not display correctly without including out.flush statements around every <c:import> statement.