JAVA WEB实现图书管理系统 —— 登录、注册页面

1、登录:
在这里插入图片描述
2、注册:
在这里插入图片描述

一、编写User类,封装用户的信息

package entity;

public class User {
   
	private String username;
	private String password;
	private String sex;
	private String age;
	public User() {
   
		super();
		// TODO Auto-generated constructor stub
	}
	public User(String username, String password, String sex, String age) {
   
		super();
		this.username = username;
		this.password = password;
		this.sex = sex;
		this.age = age;
	}
	public String getUsername() {
   
		return username;
	}
	public void setUsername(String username) {
   
		this.username = username;
	}
	public String getPassword() {
   
		return password;
	}
	public void setPassword(String password) {
   
		this.password = password;
	}
	public String getSex() {
   
		return sex;
	}
	public void setSex(String sex) {
   
		this.sex = sex;
	}
	public String getAge() {
   
		return age;
	}
	public void setAge(String age) {
   
		this.age = age;
	}
	
}

二、编写登录、注册界面

login.jsp:

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图书管理系统用户登录</title>
</head>

<center><h3>图书管理系统用户登录</h3></center>

<body style="text-align:center">

<form action="${pageContext.request.contextPath}/LoginServlet" method="post">
	<table border="0" width="350px" cellpadding="0" cellspacing="0" align="center" style="background:#CFF;">
		<tr>
			<td height="50" align="center">用户名:&nbsp;&nbsp;
			<input type="text" name="username" />${
   errorMsg}</td>
		</tr>
		<tr>
			<td height="50" align="center">&nbsp;&nbsp;码:&nbsp;&nbsp;
			<input type="password" name="password" /></td>
		</tr>
		<tr>
			<td heignt="50">
				<input type="checkbox" name="autologin" value="${60*60*24*31}" />自动登录
			</td>
		</tr>
		<tr>
			<td height="50">
				<input type="submit" value="登录" />&nbsp;&nbsp;&nbsp;&nbsp;
				
  • 24
    点赞
  • 194
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值