/
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>用户注册</title>
</head>
<body>
<form action="RegServlet" method="post">
<table align="center" width="450">
<tr>
<td align="center" colspan="2">
<h2>用户注册</h2>
<hr>
</td>
</tr>
<tr>
<td align="right">用户名:</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td align="right">性别:</td>
<td>
<input type="radio" name="sex" value="男" checked="checked">男
<input type="radio" name="sex" value="女">女
</td>
</tr>
<tr>
<td align="right">QQ号码:</td>
<td><input type="text" name="qq" /></td>
</tr>
<tr>
<td align="right">E-Mail地址:</td>
<td><input type="text" name="mail" /></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="注 册">
</td>
</tr>
</table>
</form>
</body>
</html>
/
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>录入商品信息</title>
</head>
<body>
<form action="AddServlet" method="post" οnsubmit="return check(this);">
<table align="center" width="450">
<tr>
<td align="center" colspan="2">
<h2>录入商品信息</h2>
<hr>
</td>
</tr>
<tr>
<td align="right">名称:</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td align="right">价格:</td>
<td><input type="text" name="price" /></td>
</tr>
<tr>
<td align="right">数量:</td>
<td><input type="text" name="count" /></td>
</tr>
<tr>
<td align="right">单位:</td>
<td><input type="text" name="unit" /></td>
</tr>
<tr>
<td align="right">产地:</td>
<td><input type="text" name="add" /></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="添 加">
</td>
</tr>
</table>
</form>
</body>
</html>
/
<%@ page language="java" contentType="text/html" pageEncoding="GBK"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>简易Servlet计算器</title>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function calc(form){
with(form){
if(firstNum.value == "" || secendNum.value == ""){
alert("请输入数字!");
return false;
}
if(isNaN(firstNum.value) || isNaN(secendNum.value)){
alert("数字格式错误!");
return false;
}
if(operator.value == "-1"){
alert("请选择运算符!");
return false;
}
}
}
</script>
</head>
<body>
<form action="CalculateServlet" method="post" onSubmit="return calc(this);">
<table align="center" border="0">
<tr>
<th>简易Servlet计算器</th>
</tr>
<tr>
<td>
<input type="text" name="firstNum">
<select name="operator">
<option value="-1">运算符</option>
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="text" name="secendNum">
<input type="submit" value="计算">
</td>
</tr>
</table>
</form>
</body>
</html>