JAVA+JSP+HTML+数据库 实现网页的登录和注册(全网最详细代码)
受疫情的影响自己在家鼓捣点了东西,也是项目中的一部分,实现了网页的登录和注册,在大佬面前不可一提,本人只是分享自己的实现过程,希望对看到的你有所帮助。
项目的层次图:
代码:
login.jsp(登录界面实现)
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Wopop</title>
<link href="./Wopop_files/style_log.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./Wopop_files/style.css">
<link rel="stylesheet" type="text/css" href="./Wopop_files/userpanel.css">
<link rel="stylesheet" type="text/css" href="./Wopop_files/jquery.ui.all.css">
<style type="text/css">
<!--
.STYLE1 {
font-size: 24px;
color: #000000;
font-weight: bold;
}
.p_left{display:inline;}
.p_right{display:inline;}
-->
</style>
</head>
<body class="login" mycollectionplug="bind">
<div class="login_m">
<div class="login_logo STYLE1">系统登录</div>
<div class="login_boder">
<div class="login_padding" id="login_model">
<form action="loginpost.jsp" method="post">
<%
Object error=session.getAttribute("error");
if(error!=null)
{
%>
<span style="color:red"><%=error %></span>
<%} %>
<h2>账号</h2>
<label>
<input type="text" id="username" name="username" class="txt_input txt_input2" onfocus="if (value =='Your name'){value =''}" onblur="if (value ==''){value='Your name'}" value="Your name">
</label>
<h2>密码<