首先启动ECLIPSE 在创建的TOMCAT项目工程根目录中创建index.jsp。内容如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>首页</title>
</head>
<body>
<form action="show.jsp" method="post">
<table width="300" border="1" cellspacing="5" cellpadding="2">
<tr>
<td width="41">姓名</td>
<td width="230"><input name="name" /></td>
</tr>
<tr>
<td>地址</td>
<td><input /></td>
</tr>
<tr>
<td><input value="提交" /></td>
<td><input value="重置" /></td>
</tr>
</table>
</form>
</body>
</html>
然后再创建show.jsp。内容如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>首页</title>
</head>
<body>
<p>结果页面</p>
<table width="300" border="1" cellspacing="5" cellpadding="2">
<tr>
<td width="41">姓名</td>
<td width="230"><%=request.getParameter("name")%></td>
</tr>
<tr>
<td>地址</td>
<td><%=request.getParameter("address")%></td>
</tr>
</table>
<p><a href="index.jsp">返回</a></p>
</body>
</html>
之后请看另一篇文章如何去部署到TOMCAT下。