Tutorials > Program model > Add a finder to an existing entity bean

< Previous | Next >


Modify a JSP file to use the new finder

In this step we will modify the OrderStatusTableDisplay.jsp JSP file to call the getOrdersByTimePlaced method in the ExtendedOrderListDataBean. You will modify the JSP file to change the sorting order of the list of orders that were already processed.


Procedure

  1. In the Enterprise Explorer view, navigate to Stores > WebContent Consumer_Direct_name > Snippets > Order > Cart, where Consumer_Direct_name is the name of the consumer direct sample store.

  2. Create a backup copy of OrderStatusTableDisplay.jsp:

    1. Right-click OrderStatusTableDisplay.jsp and select Copy, then select Paste.

    2. In the Name Conflict window, enter OrderStatusTableDisplay.jsp.bak .

    3. Click OK.

  3. Double-click the OrderStatusTableDisplay.jsp file to open the file for editing.

  4. Locate the following code:

    <wcbase:useBean  classname="com.ibm.commerce.order.beans.OrderListDataBean">
                <c:set target="${orderListBean2}" property="currentPage" value="${pageToDisplay}"/>
         
    <c:set target="${orderListBean2}" property="pageSize" value="${pageSize}"/>
         
    <c:set target="${orderListBean2}" property="sortMethodId" value="7"/>
                <c:set target="${orderListBean2}" property="storeId" value="${CommandContext.storeId}"/>
                <c:set target="${orderListBean2}" property="retrievalOrderStatus" value="N,M,A,B,C,R,S,D,F,G"/>
                <c:set target="${orderListBean2}" property="userId" value="${CommandContext.userId}"/>
            </wcbase:useBean>
            
            <c:set var="orderBeanList2"  value="${orderListBean2.orderDataBeansForCurrentPage}" />
    

  5. Delete the code in the preceding step and replace it with the following code:

    <wcbase:useBean  classname="com.ibm.commerce.sample.databeans.ExtendedOrderListDataBean"> 
    <c:set target="${orderListBean2}" property="currentPage" value="${pageToDisplay}"/> 
    <c:set target="${orderListBean2}" property="pageSize" value="${pageSize}"/> 
    <c:set target="${orderListBean2}" property="storeId" value="${CommandContext.storeId}"/> 
    <c:set target="${orderListBean2}" property="retrievalOrderStatus" value="N,M,A,B,C,R,S,D,F,G"/> 
    <c:set target="${orderListBean2}" property="userId" value="${userId}"/> 
    </wcbase:useBean>
    
    <c:set var="orderBeanList2" value="${orderListBean2.ordersByTimePlaced}" />
    

  6. Save the changes.

  7. Restart the WebSphere Commerce Test Server to pick up the changes.

< Previous | Next >


+

Search Tips   |   Advanced Search