2020.11.30

一、今日学习内容:

今天主要学习的是图书管理系统中的注册确认功能的jsp的编写:

注册确认功能涉及两个文件:register_confirm.jsp,表示信息确认界面;re_register.jsp,
表示重新修改界面。
52 Java Web 程序设计基础教程
register_confirm.jsp 文件:

<%@ page contentType="text/html"%>
<%@ page pageEncoding="gb2312"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:requestEncoding value="gb2312"/>
<html>
<head>
<title>注册信息确认</title>
</head>
<body>
<h2 align="center">注册信息确认</h2>
<table border="1" align="center">
<tr>
<td>用户 ID</td>
<td>${param.userid}</td>
</tr>
<tr>
<td>用户名</td>
<td>${param.username}</td>
</tr>
<tr>
<td>口令</td>
<td>${param.userpass}</td>
</tr>
<tr>
<td>Email</td>
<td>${param.email}</td>
</tr>
<tr>
<td>电话</td>
<td>${param.phone}</td>
</tr>
<tr>
<td>地址</td>
<td>${param.address}</td>
</tr>
<tr>
<td>生日</td>
<td>${param.birthday}</td>3 章 输 出 53
</tr>
<tr>
<td>地区</td>
<td>${param.local}</td>
</tr>
<tr>
<td>学历</td>
<td>${param.degree}</td>
</tr>
<tr>
<td>备注</td>
<td>${param.comment}</td>
</tr>
<tr>
<form name="form1" action="" method="post">
<input type="hidden" name="userid" value="${param.userid}">
<input type="hidden" name="username" value="${param.username}">
<input type="hidden" name="userpass" value="${param.userpass}">
<input type="hidden" name="local" value="${param.local}">
<input type="hidden" name="phone" value="${param.phone}">
<input type="hidden" name="email" value="${param.email}">
<input type="hidden" name="address" value="${param.address}">
<input type="hidden" name="comment" value="${param.comment}">
<input type="hidden" name="birthday" value="${param.birthday}">
<input type="hidden" name="degree" value="${param.degree}">
<td><input type="button" name="action1" value="确定"
onclick="this.form.action='success.jsp';this.form.submit();"></td>
<td><input type="button" name="action1" value="修改"
onclick="this.form.action='re_register.jsp';this.form.submit();"></td>
</form>
</tr>
<table>
</body>
</html>

re_register.jsp 文件(此文件与注册界面非常类似,所以只给出显示的部分,没有给出验
证部分):

<%@ page contentType="text/html"%>
<%@ page pageEncoding="gb2312"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
54 Java Web 程序设计基础教程
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<fmt:requestEncoding value="gb2312"/>
<html>
<head>
<title>修改注册信息</title>
</head>
<body>
<h2 align="center">请修改注册信息</h2>
<form name="form1" action="register_confirm.jsp" method="post"
onsubmit="return isValidate(form1)">
<table align="center">
<tr>
<td> 用户 ID:</td>
<td><input type="text" name="userid" value="${param.userid}"> </td>
</tr>
<tr>
<td> 用户名:</td>
<td><input type="text" name="username" value="${param.username}"> </td>
</tr>
<tr>
<td> 口令:</td>
<td><input type="password" name="userpass" value="${param.userpass}"></td>
</tr>
<tr>
<td> 确认口令:</td>
<td><input type="password" name="userpass2" value="${param.userpass}">
</td>
</tr>
<tr>
<td> 生日:</td>
<td><input type="text" name="birthday" value="${param.birthday}">
格式为:1988-1-1</td>
</tr>
<tr>
<td> 学历:</td>
<td>
<input type="radio" name="degree" value="专科"
<c:if test="${param.degree == \"专科\"}">checked</c:if>>专科
<input type="radio" name="degree" value="本科"
<c:if test="${param.degree == \"本科\"}">checked</c:if>>本科
 第 3 章 输 出 55
<input type="radio" name="degree" value="硕士研究生"
<c:if test="${param.degree == \"硕士\"}">checked</c:if>>硕士
<input type="radio" name="degree" value="博士研究生"
<c:if test="${param.degree == \"博士\"}">checked</c:if>>博士
<input type="radio" name="degree" value="其他"
<c:if test="${param.degree == \"其他\"}">checked</c:if>>其他
</td>
</tr>
<tr>
<td> 地区:</td>
<td>
<select name="local">
<option value="华东">华东</option>
<option value="华南"
<c:if test="${param.local == \"华南\"}">selected</c:if> >华南</option>
<option value="华北"
<c:if test="${param.local == \"华北\"}">selected</c:if> >华北</option>
<option value="东南"
<c:if test="${param.local == \"东南\"}">selected</c:if> >东南</option>
<option value="西南"
<c:if test="${param.local == \"西南\"}">selected</c:if> >西南</option>
<option value="西北"
<c:if test="${param.local == \"西北\"}">selected</c:if> >西北</option>
<option value="东北"
<c:if test="${param.local == \"东北\"}">selected</c:if> >东北</option>
<option value="华中"
<c:if test="${param.local == \"华中\"}">selected</c:if> >华中</option>
</select>
</td>
</tr>
<tr>
<td> E-mail:</td>
<td><input type="text" name="email" value="${param.email}"></td>
</tr>
<tr>
<td> 地址:</td>
<td><input type="text" name="address" value="${param.address}"></td>
</tr>
<tr>
<td> 电话:</td>
56 Java Web 程序设计基础教程
<td><input type="text" name="phone" value="${param.phone}"></td>
</tr>
<tr>
<td> 备注:</td>
<td>
<textarea rows="8" name="comment" cols="40">
${param.comment}
</textarea></td>
</tr>
<tr>
<td> <input type="reset" value="重置"></td>
<td> <input type="submit" value="提交"></td>
</tr>
<table>
</form>
</body>
</html>

二、遇到的问题:

没有什么问题。

 三、明日学习计划:

继续学习javaweb。

原文地址:https://www.cnblogs.com/marr/p/14177838.html