login.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎登陆</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body>
<form action="index.jsp" method="get">
<center>
<table>
<h1>欢迎登陆</h1>
<tr>
<td>用户名:</td>
<td>
<input type="text" name="user"value=""/></br>
</td>
</tr>
<tr>
<td>密码:</td>
<td>
<input type="password" name="password" value=""/>
</td>
</tr>
</table>
<input type="submit"value="登陆"/>
<a href="regist.jsp">注册</a>
</center>
</form>
</body>
</html>
regist.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<center>
<div>
<h1>注册</h1>
<form action="#" method="get">
请输入帐号:<input type="text" name="user"/><br/>
请输入密码: <input type="password" name="password"/> <br/>
请确认密码: <input type="password" name="password" /><br/>
<input type="submit"value="注册"/>
</form>
</div>
</center>
</body>
</html>