📄 list_dept.jsp
字号:
<%@ 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>Struts+Hibernate实现一对多关系</title>
</head>
<body>
<center>
<h1>
部门信息管理 —— Struts + Hibernate
</h1>
<hr>
<h2>
部门列表
</h2>
<form action="dept.do" method="post">
输入查询关键字:
<input type="text" name="keyWord">
<input type="hidden" name="status" value="selectlike">
<input type="hidden" name="type" value="0">
<input type="submit" value="查询">
<a href="insert_dept.jsp">添加新部门</a>
</form>
<h3>
<a href="dept.do?type=0&status=selectall">进入部门列表页</a>
<a href="emp.do?type=0&status=selectall">进入员工列表页</a>
</h3>
<logic:present name="all" scope="request">
<table border="1" width="100%">
<tr>
<td>
部门名称
</td>
<td>
部门位置
</td>
<td>
主要业务
</td>
<td colspan="4">
操作
</td>
</tr>
<logic:iterate id="dept" name="all" scope="request">
<tr>
<td>
${dept.dname}
</td>
<td>
${dept.loc}
</td>
<td>
${dept.business}
</td>
<td>
<a href="dept.do?deptno=${dept.deptno}&type=2&status=selectdeptemp">部门员工列表</a>
</td>
<td>
<a href="insert_emp.jsp?deptno=${dept.deptno}">添加员工</a>
</td>
<td>
<a href="dept.do?deptno=${dept.deptno}&type=2&status=selectid">更新</a>
</td>
<td>
<a href="dept.do?deptno=${dept.deptno}&type=2&status=delete">删除</a>
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
<logic:notPresent name="all" scope="request">
<h3>
没有数据!
</h3>
</logic:notPresent>
</center>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -