JavaWeb——升级赛-学生成绩管理系统(1)jsp---19.01.03
2024-08-26 00:40:44
add.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加信息</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加信息</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: blue;">添加信息</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet method=add" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" />
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//判断是否空
if(name.value == '')
{
alert('名字为空');
name.focus();
return false;
}
if(grade.value == '')
{
alert('分数为空');
place.focus();
return false;
}
}
</script>
</body>
</html>
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: blue;">添加信息</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet method=add" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" />
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//判断是否空
if(name.value == '')
{
alert('名字为空');
name.focus();
return false;
}
if(grade.value == '')
{
alert('分数为空');
place.focus();
return false;
}
}
</script>
</body>
</html>
del.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: blue;">信息删除</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet?method=getcoursebyname" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
<button type="submit" class="b">查 找</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");
//非空
if(name.value == '')
{
alert('姓名为空');
name.focus();
return false;
}
}
</script>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: blue;">信息删除</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet?method=getcoursebyname" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
<button type="submit" class="b">查 找</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");
//非空
if(name.value == '')
{
alert('姓名为空');
name.focus();
return false;
}
}
</script>
</body>
</html>
detail.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>按ID查询</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">信息删除</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>姓名</td>
<td>${course.name}</td>
</tr>
<tr>
<td>分数</td>
<td>${course.grade}</td>
</tr>
</table>
<div class="a">
<a onclick="return check()" href="servlet?method=del&id=${course.id}">删 除</a>
</div>
</div>
<script type="text/javascript">
function check() {
if (confirm("真的要删除吗?"))
{
return true;
}
else
{
return false;
}
}
</script>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>按ID查询</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">信息删除</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>姓名</td>
<td>${course.name}</td>
</tr>
<tr>
<td>分数</td>
<td>${course.grade}</td>
</tr>
</table>
<div class="a">
<a onclick="return check()" href="servlet?method=del&id=${course.id}">删 除</a>
</div>
</div>
<script type="text/javascript">
function check() {
if (confirm("真的要删除吗?"))
{
return true;
}
else
{
return false;
}
}
</script>
</body>
</html>
detail2.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>按名字查询</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: red;">物资信息修改</h1>
<a href="index.jsp">返回主页</a>
<form action="CourseServlet?method=update" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name" value="${course.name}"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" value="${course.grade}"/>
</div>
<input type="hidden" id="id" name="id" value="${course.id}"/>
<div class="a">
<button type="submit" class="b">修 改</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//非空
if(name.value == '')
{
alert('姓名为空');
name.focus();
return false;
}
if(grade.value == '')
{
alert('分数为空');
place.focus();
return false;
}
}
</script>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>按名字查询</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: red;">物资信息修改</h1>
<a href="index.jsp">返回主页</a>
<form action="CourseServlet?method=update" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name" value="${course.name}"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" value="${course.grade}"/>
</div>
<input type="hidden" id="id" name="id" value="${course.id}"/>
<div class="a">
<button type="submit" class="b">修 改</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//非空
if(name.value == '')
{
alert('姓名为空');
name.focus();
return false;
}
if(grade.value == '')
{
alert('分数为空');
place.focus();
return false;
}
}
</script>
</body>
</html>
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
<style>
.a{
font-size: 26px;
margin-top: 20px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">查分系统</h1>
<div class="a">
<a href="add.jsp">添加信息</a>
</div>
<div class="a">
<a href="servlet?method=list">信息修改</a>
</div>
<div class="a">
<a href="del.jsp">信息删除</a>
</div>
<div class="a">
<a href="search.jsp">信息搜索</a>
</div>
</div>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
<style>
.a{
font-size: 26px;
margin-top: 20px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">查分系统</h1>
<div class="a">
<a href="add.jsp">添加信息</a>
</div>
<div class="a">
<a href="servlet?method=list">信息修改</a>
</div>
<div class="a">
<a href="del.jsp">信息删除</a>
</div>
<div class="a">
<a href="search.jsp">信息搜索</a>
</div>
</div>
</body>
</html>
list.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>遍历</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: red;">信息列表</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>id</td>
<td>姓名</td>
<td>分数</td>
<td align="center" colspan="2">操作</td>
</tr>
<c:forEach items="${courses}" var="item">
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
<td>${item.grade}</td>
<td><a href="servlet?method=getCourseById&id=${item.id}">修改</a></td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>遍历</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: red;">信息列表</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>id</td>
<td>姓名</td>
<td>分数</td>
<td align="center" colspan="2">操作</td>
</tr>
<c:forEach items="${courses}" var="item">
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
<td>${item.grade}</td>
<td><a href="servlet?method=getCourseById&id=${item.id}">修改</a></td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
search.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>搜索</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">物资信息查询</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet?method=search" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" />
</div>
<div class="a">
<button type="submit" class="b">查 询</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//非空
if(name.value == '' && grade.value == '' )
{
alert('请填写一个条件');
return false;
}
}
</script>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>搜索</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: blue;">物资信息查询</h1>
<a href="index.jsp">返回主页</a>
<form action="servlet?method=search" method="post" onsubmit="return check()">
<div class="a">
姓名<input type="text" id="name" name="name"/>
</div>
<div class="a">
分数<input type="text" id="grade" name="grade" />
</div>
<div class="a">
<button type="submit" class="b">查 询</button>
</div>
</form>
</div>
<script type="text/javascript">
function check()
{
var name = document.getElementById("name");;
var grade = document.getElementById("grade");
//非空
if(name.value == '' && grade.value == '' )
{
alert('请填写一个条件');
return false;
}
}
</script>
</body>
</html>
searchlist.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: red;">信息列表</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>id</td>
<td>姓名</td>
<td>分数</td>
</tr>
<!-- forEach遍历出adminBeans -->
<c:forEach items="${courses}" var="item" varStatus="status">
<tr>
<td>${item.id}</td>
<td><a>${item.name}</a></td>
<td>${item.grade}</td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
.a{
margin-top: 20px;
}
.b{
font-size: 20px;
width: 160px;
color: white;
background-color: greenyellow;
}
.tb, td {
border: 1px solid black;
font-size: 22px;
}
</style>
</head>
<body>
<div align="center">
<h1 style="color: red;">信息列表</h1>
<a href="index.jsp">返回主页</a>
<table class="tb">
<tr>
<td>id</td>
<td>姓名</td>
<td>分数</td>
</tr>
<!-- forEach遍历出adminBeans -->
<c:forEach items="${courses}" var="item" varStatus="status">
<tr>
<td>${item.id}</td>
<td><a>${item.name}</a></td>
<td>${item.grade}</td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
jsp部分
最新文章
- js的一些属性
- [BTS] The value ";"; for the property InboundId is invalid
- java equals 和 ";=="; 比较
- HLS视频直播
- 在linux终端下打开pdf文件
- 更改cmd代码页,修正语言显示
- oracle数据库表空间及归档
- PowerShell: 如何解决File **.ps1 cannot be loaded because the execution of scripts is disabled on this sy
- Java学习之InputStream中read()与read(byte[] b)
- virus.win32.parite.H查杀病毒的方法
- CodeForces 710C Magic Odd Square
- Tomcat服务器的配置
- 计算1-1/3+1/5-1/7+&#183;&#183;&#183;的前n项和
- CocosCreator检测动作执行完毕的方法~之一吧,应该= =
- pytorch中tensorboardX的用法
- [转]win10中安装JDK8以及环境配置
- 史上最全python面试题详解 (二)(附带详细答案(关注、持续更新))
- android 读取EXcel 文件 读取文件内存卡的权限
- JSON格式说明
- android开发(3):列表listview的实现 | 下拉刷新