📄 viewcart.jsp
字号:
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@page contentType="text/html; charset=GBK"%>
<html:html>
<head>
<title>购物车</title>
<script language="JavaScript" type="text/javascript" >
function doDifferent(obj)
{
document.shoppingForm.event.value= obj;
document.shoppingForm.submit();
}
</script></head>
<body>
<html:form action="/shoppingAction.do" method="POST">
<html:hidden property="event" value="save"/>
<table width="100%" border="0" align="center">
<tr>
<td bgcolor="#EEEEEE">
<div align="center"> 购物车
<table border="1">
<tr>
<td>商品名称</td>
<td>商品描述</td>
<td>单价</td>
<td>数量</td>
<td>小计</td>
<td colspan="2">操作</td>
</tr>
<logic:iterate id="item" name="shoppingForm" property="cart">
<tr>
<td>
<bean:write name="item" property="product.name"/>
</td>
<td>
<bean:write name="item" property="product.note"/>
</td>
<td>
<bean:write name="item" property="product.price" format="####.##"/>
</td>
<td>
<bean:write name="item" property="quantity" format="####"/>
</td>
<td>
<bean:write name="item" property="itemPrice" format="####.##"/>
</td>
<td>
<a href="shoppingAction.do?event=removeproduct&productId=<bean:write name="item" property="product.productId" />">删除</a>
</td>
</tr>
</logic:iterate>
</table>
<tr align="right">
<td>合计:</td>
<td>
<bean:write name="shoppingForm" property="cart.totalPrice" format="####.##"/>
</td>
</tr>
</div>
</td>
</tr>
</table>
<div align="center">
<html:button property="" value="继续购物" onclick="doDifferent('')"/>
<html:button property="" value="结帐" onclick="doDifferent('checkout')"/>
</div>
</html:form>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -