web商品系统
12.12
今天在写web商品系统,没有遇到什么问题,商品系统已经完成一大不分了,计划明天写完:
下面是今天搞出来的代码部分:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>增加商品页面</title>
</head>
<body>
<script>
var add='<%=request.getParameter("add")%>';
if(add=="yes"){
alert("添加成功!");
}
</script>
<form action="servlet?method=add" method="post">
<table align="center">
<tr>
<td>名称:</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>价格:</td>
<td>
<input type="text" name="jiage">
</td>
</tr>
<tr>
<td>数量:</td>
<td>
<input type="text" name="shuliang">
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="确定" >
<input type="submit" value="返回" formaction="add.jsp" formmethod="post">
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除商品页面</title>
</head>
<body>
<script>
var delet='<%=request.getParameter("delete")%>';
if(delet=='yes'){
alert("删除成功!");
}
</script>
<form action="servlet?method=delete" method="post">
<table align="center">
<tr>
<td>请输入要删除商品的名称:</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="确定">
<input type="submit" value="返回" formaction="gongneng.jsp" formmethod="post">
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除商品页面</title>
</head>
<body>
<script>
var delet='<%=request.getParameter("deletes")%>';
if(delet=='yes'){
alert("购买成功!");
}
</script>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>功能选择界面</title>
</head>
<body>
<form>
<table align="center" border="1">
<tr align="center">
<td>
<input type="submit" value="增加商品" formaction="add.jsp" formmethod="post">
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="删除商品" formaction="delete.jsp " formmethod="post">
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="修改商品" formaction="update.jsp" formmethod="post">
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="买商品" formaction="servlet?method=show" formmethod="post">
</td>
</tr>
</table>
</form>
</body>
</html>