<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#father{
background-image: url("images/大壁纸.jpg");
}
.boss{
width: 300px;
background-color: #449C52;
margin-top: 200px;
margin-left: 550px;
opacity:0.4;
filter:alpha(opacity=70);
}
.bosss{
text-align: center;
}
</style>
<script type="text/javascript">
function show() {
var u=document.getElementById("username").value;
var p=document.getElementById("password").value;
var reg=/^\w{6,20}$/;
var reg1=/^\w{6,}$/;
if(!reg.test(u)){
alert("用户名输入错误,6-20位英文字母数字下划线");
return false;
}
if(!reg1.test(p)){
alert("密码输入错误,6位以上英文字母数字下划线");
return false;}}
</script>
</head>
<body id="father">
<%
//从后台传过来的request里把返回信息拿到
String resultMsg=(String)request.getAttribute("resultMsg");
%>
<%
if(resultMsg!=null&&!resultMsg.isEmpty()) {
%>
<p>返回信息:<%=resultMsg %></p>
<%} %>
<div class="boss">
<form id="f1" onsubmit="return show()" action="loginServlet" mothed="post">
<div class="bosss">
<h3>~~~&&&欢迎您登陆&&&~~~</h3><br>
<ul>
<li><p><input type="text" name="username" id="username" placeholder="请输入您的用户名"></p></li><br>
<li><p><input type="password" name="password" id="password" placeholder="请输入密码"></p></li><br>
</ul>
<input type="submit"><span>                  </span><input type="reset">
</div>
</form>
</div>
</body>
</html>
网友评论