|
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
<!-- 以上两行是JSP页面的指令,第一行设置页面内容类型为HTML且编码为UTF-8,语言为Java;
|
|
|
第二行引入JSTL核心标签库,方便在页面中进行逻辑处理等操作 -->
|
|
|
<html>
|
|
|
<head>
|
|
|
<title>公告发布</title>
|
|
|
<!-- 设置页面标题为“公告发布” -->
|
|
|
<link rel="stylesheet" href="./css/layui.css">
|
|
|
<!-- 引入layui的样式文件,用于页面布局和样式美化 -->
|
|
|
<link rel="stylesheet" href="./css/style.css">
|
|
|
<!-- 引入自定义的style.css样式文件,可能包含针对该页面的特定样式 -->
|
|
|
<script src="./layui.js"></script>
|
|
|
<!-- 引入layui的JavaScript脚本文件,提供各种交互功能等 -->
|
|
|
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
|
|
|
<!-- 引入jQuery库,方便进行DOM操作、事件处理等 -->
|
|
|
<style type="text/css">
|
|
|
.input-block {
|
|
|
margin-left: 0px;
|
|
|
min-height: 36px;
|
|
|
}
|
|
|
/* 定义类名为.input-block的样式,设置左边距为0像素,最小高度为36像素 */
|
|
|
#addnotifybutton {
|
|
|
text-align: center;
|
|
|
}
|
|
|
/* 定义id为addnotifybutton的元素样式,使其内部文本居中对齐 */
|
|
|
.layui-btn {
|
|
|
width: 30%;
|
|
|
}
|
|
|
/* 定义类名为layui-btn的按钮样式,设置宽度为30% */
|
|
|
</style>
|
|
|
</head>
|
|
|
<body class="layui-layout-body" style="background-color: #F2F2F2">
|
|
|
<!-- 设置页面主体的类名和背景颜色,可能与layui的布局样式相关 -->
|
|
|
<jsp:include page="/filterLogin.jsp"></jsp:include>
|
|
|
<!-- 包含filterLogin.jsp页面,可能用于登录验证等相关功能 -->
|
|
|
<jsp:include page="/WEB-INF/admin/aHeader.jsp"></jsp:include>
|
|
|
<!-- 包含aHeader.jsp页面,通常用于页面头部布局等内容 -->
|
|
|
<jsp:include page="/WEB-INF/admin/adminNav.jsp"></jsp:include>
|
|
|
<!-- 包含adminNav.jsp页面,一般用于展示页面导航栏相关内容 -->
|
|
|
<div class="layui-layout layui-layout-admin">
|
|
|
<div class="layui-body">
|
|
|
<!-- 内容主体区域 -->
|
|
|
<div style="padding: 15px;">
|
|
|
<span class="layui-breadcrumb">
|
|
|
<a>管理员</a>
|
|
|
<a>系统管理</a>
|
|
|
<a><cite>公告发布</cite></a>
|
|
|
</span>
|
|
|
<!-- 展示面包屑导航,显示当前页面在系统中的层级位置 -->
|
|
|
<p> </p>
|
|
|
<form action="${pageContext.request.contextPath}/addNotifyServlet" method="post">
|
|
|
<!-- 创建一个表单,表单提交的目标地址是addNotifyServlet,提交方式为POST -->
|
|
|
<div class="input-block">
|
|
|
<textarea name="notifyInfo" placeholder="请输入内容" class="layui-textarea" required lay-verify="required"></textarea>
|
|
|
<!-- 创建一个文本域,用于输入公告内容,设置了名称、占位提示文本、样式类以及必填验证等属性 -->
|
|
|
<p>
|
|
|
</div>
|
|
|
<%-- <input type="text" name="notifyInfo" />--%>
|
|
|
<div id="addnotifybutton">
|
|
|
<button type="submit" class="layui-btn">发布</button>
|
|
|
</div>
|
|
|
<!-- 创建一个按钮,类型为提交按钮,样式类为layui-btn,点击时会提交表单 -->
|
|
|
</form>
|
|
|
|
|
|
<table class="layui-table" lay-filter="test">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>公告ID</th>
|
|
|
<th>公告日期</th>
|
|
|
<th>公告内容</th>
|
|
|
<th>操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<!-- 定义表格的表头,包含公告ID、日期、内容和操作列 -->
|
|
|
<c:forEach items="${notifys}" var="notify">
|
|
|
<tr>
|
|
|
<td>${notify.id}</td>
|
|
|
<td>${notify.notifyDate}</td>
|
|
|
<td>${notify.notifyInfo}</td>
|
|
|
<td><button class="layui-btn layui-btn-normal">修改</button><button class="layui-btn layui-btn-danger">删除</button></td>
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
|
<!-- 使用JSTL的forEach标签循环遍历notifys集合,将每个元素(这里假设是公告对象)的数据展示在表格行中,
|
|
|
每行包含公告的相关信息以及修改和删除按钮 -->
|
|
|
</table>
|
|
|
|
|
|
<jsp:include page="/footer.jsp"></jsp:include>
|
|
|
<!-- 包含footer.jsp页面,通常用于页面底部相关内容展示,比如版权信息等 -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
$("#nav li:nth-child(5) dl dd:nth-child(1)").addClass("layui-this");
|
|
|
// 使用jQuery选择器选中特定的导航栏元素(第5个li下的第一个dl下的第一个dd),并添加类名layui-this,
|
|
|
// 可能用于标记当前选中的导航项样式
|
|
|
$("#nav li:nth-child(5)").addClass("layui-nav-itemed");
|
|
|
// 使用jQuery选择器选中特定的导航栏元素(第5个li),并添加类名layui-nav-itemed,
|
|
|
// 可能用于展开或标记特定导航栏的展开状态相关样式
|
|
|
</script>
|
|
|
<script>
|
|
|
//JavaScript代码区域
|
|
|
layui.use('element', function(){
|
|
|
var element = layui.element;
|
|
|
element.init();
|
|
|
});
|
|
|
// 使用layui框架的element模块,调用init方法进行初始化,可能用于初始化页面的一些交互元素等功能
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
</html> |