文章目录
整体分为顶部头部,左侧菜单,右侧展示栏
一、案例演示
二、登录页面
1、登录页面
2、demo02_login.jsp
<%@page isELIgnored= "false" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<script type="text/javascript" src="../js/jquery02.js"></script>
<script type="text/javascript" src="../js/js_login_demo02.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html{
height: 100%;
width: 100%;
overflow: hidden;
margin: 0;
padding: 0;
background-image: url("Desert.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}a
.loginDiv{
width: 37%;
display: flex;
justify-content: center;
align-items: center;
height: 300px;
background-color: rgba(75, 81, 95, 0.3);
box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
border-radius: 5px;
}
#name_trip {
margin-left: 50px;
color: red;
}
p {
margin-top: 30px;
margin-left: 20px;
color: azure;
}
input {
margin-left: 15px;
border-radius: 5px;
border-style: hidden;
height: 30px;
width: 140px;
background-color: rgba(216, 191, 216, 0.5);
outline: none;
color: #f0edf3;
padding-left: 10px;
}
.button {
border-color: cornsilk;
background-color: rgba(100, 149, 237, .7);
color: aliceblue;
border-style: hidden;
border-radius: 5px;
width: 100px;
height: 31px;
font-size: 16px;
}
</style>
<body>
<form id="form" class="loginDiv">
<h1 style="text-align: center;color: aliceblue;">登陆</h1>
<p> 账号:<input name="username" type="text" id="username"/><br><label id="name_trip"></label></p>
<p>密码:<input name="password" type="text" id="password"/><br><label id="password_trip"></label></p>
<div style="text-align: center;margin-top: 30px;">
<input type="button" class="button" value="登录" onclick="json()"/>
<input type="reset" class="button" value="重置">
</div>
</form>
</body>
</html>
三、注册页面
1、注册页面
2、demo02_update.jsp
<%--
Created by IntelliJ IDEA.
User: Dell
Date: 2022/10/14
Time: 9:27
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored= "false" %>
<html>
<head>
<title>Title</title>
</head>
<script type="text/javascript" src="../js/jquery02.js"></script>
<script type="text/javascript" src="../js/js_register_demo02.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
width: 100%;
overflow: hidden;
margin: 0;
padding: 0;
background: url(background.jpg) no-repeat 0px 0px;
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
#loginDiv {
width: 37%;
display: flex;
justify-content: center;
align-items: center;
height: 650px;
background-color: rgba(75, 81, 95, 0.3);
box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
border-radius: 5px;
}
#name_trip {
margin-left: 50px;
color: red;
}
p,
.sexDiv {
margin-top: 10px;
margin-left: 20px;
color: azure;
}
.sexDiv>input,
.hobby>input {
width: 30px;
height: 17px;
}
input,
select {
margin-left: 15px;
border-radius: 5px;
border-style: hidden;
height: 30px;
width: 140px;
background-color: rgba(216, 191, 216, 0.5);
outline: none;
color: #f0edf3;
padding-left: 10px;
}
.button {
border-color: cornsilk;
background-color: rgba(100, 149, 237, .7);
color: aliceblue;
border-style: hidden;
border-radius: 5px;
width: 100px;
height: 31px;
font-size: 16px;
}
.introduce {
margin-left: 110px;
}
.introduce>textarea {
background-color: rgba(216, 191, 216, 0.5);
border-style: hidden;
outline: none;
border-radius: 5px;
}
h1 {
text-align: center;
margin-bottom: 20px;
margin-top: 20px;
color: #000000;
}
b {
margin-left: 50px;
color: #FFEB3B;
font-size: 10px;
font-weight: initial;
}
</style>
<body>
<form class="registerlogin" id="registerlogin" method="post">
<h1>注册</h1>
<p>用户姓名:<input name="name" type="text" id="username"/><label id="name_trip"></label></p>
<p>用户密码:<input name="password" type="text" id="password"/><label id="password_trip"></label></p>
<p>确认密码:<input id="surePassword" type="password"/><label id="surePassword_trip"></label></p>
<p style="text-align: center;">
<input type="button" class="button" value="注册" onclick="register()">
<input type="reset" class="button" value="重置">
</p>
</form>
</body>
</html>
四、修改布局页面
1、修改密码页面
2、demo02_update.jsp
<%--
Created by IntelliJ IDEA.
User: Dell
Date: 2022/10/14
Time: 10:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<script type="text/javascript" src="../js/jquery02.js"></script>
<script type="text/javascript" src="../js/js_update_demo02.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
width: 100%;
overflow: hidden;
margin: 0;
padding: 0;
background: url(img2.jpg) no-repeat 0px 0px;
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
#loginDiv {
width: 37%;
display: flex;
justify-content: center;
align-items: center;
height: 650px;
background-color: rgba(75, 81, 95, 0.3);
box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
border-radius: 5px;
}
#name_trip {
margin-left: 50px;
color: red;
}
p,
.sexDiv {
margin-top: 10px;
margin-left: 20px;
color: azure;
}
.sexDiv>input,
.hobby>input {
width: 30px;
height: 17px;
}
input,
select {
margin-left: 15px;
border-radius: 5px;
border-style: hidden;
height: 30px;
width: 140px;
background-color: rgba(216, 191, 216, 0.5);
outline: none;
color: #f0edf3;
padding-left: 10px;
}
.button {
border-color: cornsilk;
background-color: rgba(100, 149, 237, .7);
color: aliceblue;
border-style: hidden;
border-radius: 5px;
width: 100px;
height: 31px;
font-size: 16px;
}
.introduce {
margin-left: 110px;
}
.introduce>textarea {
background-color: rgba(216, 191, 216, 0.5);
border-style: hidden;
outline: none;
border-radius: 5px;
}
h1 {
text-align: center;
margin-bottom: 20px;
margin-top: 20px;
color: #020101;
}
b {
margin-left: 50px;
color: #FFEB3B;
font-size: 10px;
font-weight: initial;
}
</style>
<body>
<form class="registerlogin" id="update" method="post">
<h1>修改密码</h1>
<p>指定账号:<input type="text" name="name"><br><label id="name_trip"></label></p>
<p>修改密码:<input type="text" name="password"><br><label id="password_trip"></label></p>
<p>确认密码:<input type="text"><br><label id="surePassword_trip"></label></p>
<p style="text-align: center;">
<input type="button" class="button" value="修改" onclick="update()">
<input type="reset" class="button" value="重置">
</p>
</form>
</div>
</body>
</html>
五、后台页面
1、mainlogin.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.div1{
width: 150px;
height: 300px;
border: 1px solid;
text-align: center;
float: left;
background: aqua;
}
.div2{
width: 1300px;
height: 600px;
float: left;
}
.div2 iframe{
width: 100%;
height: 600px;
}
a{
text-decoration: none;
}
.title{
width: 100%;
height: 70px;
background: chartreuse;
text-align: center;
line-height: 70px;
}
</style>
</head>
<body>
<%--标题--%>
<div class="title">
<h1>欢迎来到后台页面</h1>
<div >
</div>
</div>
<%--菜单--%>
<div class="div1">
<div class="123">
<a href="#" style="color: blue">首页</a>
</div>
<hr>
<div>
<!-- <a> 标签的 target 属性规定在何处打开链接文档-->
<a href="http://localhost:8080/javaee_war_exploded/jsp/demo02_update.jsp" target="test">修改密码</a>
</div>
<hr>
<div>
<a href="http://localhost:8080/javaee_war_exploded/jsp/demo02_login.jsp" target="test">登录页面</a>
</div>
<hr>
<div>
<a href="http://localhost:8080/javaee_war_exploded/jsp/demo02_register.jsp" target="test">注册页面</a>
</div>
<hr>
</div>
<%--显示栏--%>
<div class="div2">
<iframe name="test"></iframe>
</div>
</body>
</html>