1,index.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>首页</title>
<style>
body{
margin: 0 auto;
text-align: center;
}
</style>
</head>
<body>
<h1>首页</h1>
<hr>
<a href="${pageContext.request.contextPath}/register.jsp">注册</a>
</body>
</html>
2,register.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>注册</title>
<script>
var status = '${sessionScope.pwdFail}';
if (status=='yes'){
alert("两次密码输入不一样,请重新输入");
}
</script>
</head>
<body>
<h1>注册</h1>
<form action="${pageContext.request.contextPath}/registServlet" method="post">
<p>用户名: <input type="text" name="username" required ></p>
<p>密码:<input type="password" name="password1" required></p>
<p>确认密码:<input type="password" na