?? shopping.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,item)
{
if(obj == 'addproduct'){
while(item.tagName!="TR"){
item = item.parentElement;
}
if(item.tagName!="TR") return;
document.shoppingForm.id.value = item.cells(0).children(0).value;
document.shoppingForm.quantity.value = item.cells(3).children(0).value;
}
document.shoppingForm.event.value= obj;
document.shoppingForm.submit();
}
</script></head>
<body>
<html:form action="/shoppingAction.do" method="POST">
<html:hidden property="event"/>
<html:hidden property="quantity"/>
<html:hidden property="id"/>
<table width="100%" border="0">
<tr>
<td bgcolor="#EEEEEE">
<div align="center"> 商品瀏覽
<table border="0" cellspacing="2" cellpadding="5" bgcolor="#008800">
<tr bgcolor="#cccccc">
<td>商品名稱</td>
<td>商品描述</td>
<td>價格</td>
<td>購買數(shù)量</td>
<td colspan="2">操作</td>
</tr>
<logic:iterate id="item" name="shoppingForm" property="productList">
<tr bgcolor="#ffff88">
<td>
<html:hidden name="item" property="productId"/>
<bean:write name="item" property="name"/>
</td>
<td>
<bean:write name="item" property="note"/>
</td>
<td>
<bean:write name="item" property="price" format="####.##"/>
</td>
<td>
<input type="text"/>
</td>
<td>
<html:button property="" onclick="doDifferent('addproduct',this)">放入購物車</html:button>
</td>
</tr>
</logic:iterate>
</table>
</div>
</td>
</tr>
</table>
<div align="center">
<html:button property="" value="查看購物車" onclick="doDifferent('viewcart')"/>
</div>
</html:form>
</body>
</html:html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -