⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cars.jsp

📁 利用jsp中的技术
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ 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"%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>网上商店</title>
</head>
<body>
欢迎进入网上商店:
<bean:write name="loginForm" property="username" />

<br>

<table border="1" cellspacing="1" cellpadding="1" align="center">
<logic:notEmpty name="carForm" property="carList" >
<logic:iterate indexId="index" id="item" name ="carForm" property="carList">
    <tr>
		<td class="allcapsCenter"><bean:write name="item" property="name" /></td>
        <td class="allcapsCenter"><bean:write name="item" property="priceString" /></td>
        <td><bean:write name="item" property="description" /></td>  
        <td nowrap class="center">
        	<a href="javascript:submitCar(document.fview, '<bean:write name="item" property="name" />')">查看</a>
			<font class="redBold">||</font>
			<a href="javascript:submitCar(document.fadd, '<bean:write name="item" property="name" />')">购买</a>
			</td>     
	</tr>
</logic:iterate>
</logic:notEmpty>
</table>

<logic:notEmpty name="carForm" property="buyList" >
已购买的商品:
<table border="1" cellspacing="1" cellpadding="1" align="center">
<logic:iterate indexId="index" id="item" name ="carForm" property="buyList">
    <tr>
		<td class="allcapsCenter"><bean:write name="item" property="name" /></td>
        <td class="allcapsCenter"><bean:write name="item" property="priceString" /></td>
	</tr>
</logic:iterate>
</table>
</logic:notEmpty>

<html:form action="car.do?mode=view" method="post" styleId="fview">
	<input type="hidden" id="hid" name="hid" />
</html:form>

<html:form action="car.do?mode=add" method="post" styleId="fadd">
	<input type="hidden" id="hid" name="hid" />
</html:form>
<a href="javascript:window.location('car.do?mode=done')">确认</a>
<br>
<a href="javascript:window.location('login.jsp')">取消</a>

</body>

<script language="JavaScript">
<!--
function submitCar(form, hid) {
    form.hid.value = hid;
    form.submit();
}
// -->
</script>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -