首先是网页前端的设计,使用css美化(字体使用Google font,图标使用font awemome,颜色使用palettes|flat ui colors,谷歌可找到,个人觉得挺好用)
使用了简单的js进行表单验证用户名长度、密码、确认密码
登录界面
注册界面
把前端代码写到jsp里面了,通过表单post提交到action,进行相应的业务逻辑处理操作
**main.jsp**
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta charset="utf-8">
<title>login-register</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
</head>
<body>
<div class="bt">
<i class="fas fa-long-arrow-alt-right"></i>Login my own account<br/>
</div>
<div class="register">
<i class="fas fa-registered"></i>Register new account
</div>
<div class="login-box">
<div class="hide-bt1">
<i class="fas fa-times"></i>
</div>
<form action="login_check.jsp" method="post" class="login-form">
<h1>Welcome</h1>
<input type="text" name="username" id="" class="text" placeholder="USERNAME" />
<input type="password" name="password" id="" class="text" placeholder="PASSWORD" />
<input type="submit" name="" class="login-bt" id="" value="Login" />
</form>
</div>
<div class="register-box">
<div class="hide-bt2">
<i class="fas fa-times"