Author Topic: JSP/HTML Error fix for EditCartBody.jsp  (Read 144 times)

pyr0t3chnician

  • Newbie
  • *
  • Posts: 3
    • View Profile
JSP/HTML Error fix for EditCartBody.jsp
« on: January 30, 2012, 12:51:57 PM »
Around line 75 is the cart logic for checking an empty shopping cart in the EditCartBody.jsp file:

Code: [Select]
<div class="body-content-div">
    <logic:empty  property="itemList" name="EditCartForm">
        <div class="msg-box"><bean:message key="edit.cart.body.emptycart"/></div>
    </logic:empty>
    <logic:notEmpty property="itemList" name="EditCartForm">
        //Everything else happens here
        </div>
    </logic:notEmpty>
</html:form>

The nesting is incorrect, so if your cart is empty, you will be missing your closing tag for the 'body-content-div'.
The two fixes for this are adding a closing </div> tag to the <logic:empty> section:
Code: [Select]
<div class="body-content-div">
    <logic:empty  property="itemList" name="EditCartForm">
        <div class="msg-box"><bean:message key="edit.cart.body.emptycart"/></div>
    </div>
    </logic:empty>
    <logic:notEmpty property="itemList" name="EditCartForm">
        //Everything else happens here
        </div>
    </logic:notEmpty>
</html:form>
OR taking the last </div> in the <logic:notEmpty> tag and putting it just outside the tag:
Code: [Select]
<div class="body-content-div">
    <logic:empty  property="itemList" name="EditCartForm">
        <div class="msg-box"><bean:message key="edit.cart.body.emptycart"/></div>
    </div>
    </logic:empty>
    <logic:notEmpty property="itemList" name="EditCartForm">
        //Everything else happens here
    </logic:notEmpty>
    </div>
</html:form>

That should help fix any layout issues you may be having with this page.