list_student_course.jsp

来自「java 框架核心技术编程」· JSP 代码 · 共 93 行

JSP
93
字号
<%@ page language="java" pageEncoding="GBK"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<html:html lang="true">
<head>
	<title>学生选课系统——Hibernate 多对多实现</title>
</head>

<body>
	<center>
		<h1>
			学生选课系统 —— Struts + Hibernate
		</h1>
		<hr>
		<br>
		<h3>
			<a href="course.do?type=0&status=selectall">课程列表</a> &nbsp;&nbsp;
			<a href="student.do?type=0&status=selectall">学生列表</a>
		</h3>
		<logic:present name="student" scope="request">
			<h2 align="left">
				姓名:${student.name}
			</h2>
			<h2 align="left">
				年龄:${student.age}
			</h2>
			<h2 align="left">
				性别:${student.sex}
			</h2>
			<table border="1" width="100%">
				<tr>
					<td>
						编号
					</td>
					<td>
						课程名称
					</td>
					<td>
						任课教师
					</td>
					<td>
						学分
					</td>
					<td colspan="4">
						操作
					</td>
				</tr>
				<bean:define id="all" name="student" property="courses"></bean:define>
				<logic:iterate id="cre" name="all">
					<tr>
						<td>
							${cre.cid}
						</td>
						<td>
							${cre.name}
						</td>
						<td>
							${cre.teacher}
						</td>
						<td>
							${cre.creditHour}
						</td>
						<td>
							<a
								href="course.do?status=selectcoursestudent&type=1&cid=${cre.cid}">参加学生列表</a>
						</td>
						<td>
							<a
								href="course.do?status=cancelchoosecourse&type=0&cid=${cre.cid}&sid=${student.sid}">取消</a>
						</td>
						<td>
							<a href="course.do?status=selectid&type=1&cid=${cre.cid}">修改</a>
						</td>
						<td>
							<a href="course.do?status=delete&type=1&cid=${cre.cid}">删除</a>
						</td>
					</tr>
				</logic:iterate>
			</table>
		</logic:present>
		<logic:notPresent name="student" scope="request">
			<h3>
				没有任何数据!
			</h3>
		</logic:notPresent>
	</center>
</body>
</html:html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?