You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
library_manage_system/WebContent/reader/07announcement.jsp

59 lines
2.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ page import="java.sql.*" %> <!-- 导入Java SQL包用于数据库操作 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> <!-- 设置页面语言为Java内容类型为HTML字符编码为UTF-8 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 定义文档类型为HTML 4.01 Transitional -->
<html>
<head>
<meta charset="utf-8"> <!-- 设置字符编码为UTF-8 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- 设置IE浏览器的兼容模式 -->
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 设置视口宽度和初始缩放比例 -->
<title></title> <!-- 页面标题 -->
<!-- Bootstrap CSS文件 -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery所以必须放在前边) -->
<style>
body{
font-family:YouYuan; /* 设置页面字体为YouYuan */
}
</style>
</head>
<body>
<div style="background: steelblue;height: 30px;color:#fff;border-radius: 8px;width: 90%;margin:auto auto;">
<marquee style="font-size:20px;font-family:YouYuan;" behavior="scroll" direction="left" hspace="0.1%" vspace="0.1%" loop="-1" scrollamount="20" scrolldelay="100" "this.start()" "this.stop()">
&#10084;图书馆公告栏,记得查收公告呀!&#10084; <!-- 滚动公告栏 -->
</marquee>
</div>
<div class="a" align="center">
<h2>近期公告</h2> <!-- 显示“近期公告”标题 -->
<jsp:useBean id="check" scope="session" class="javabean.JDBCBean"></jsp:useBean> <!-- 使用JSP标签声明一个JavaBean对象ID为check作用域为session类为javabean.JDBCBean -->
<!-- SQL查询语句选择announcement表中的所有记录 -->
<!-- 执行SQL查询并将结果存储在ResultSet对象rs中 -->
<%
String sql="select*from announcement";
ResultSet rs = check.executeQuery(sql);
while (rs.next()) {
%>
<div class="panel panel-info" style="margin-left:5%;width:80%;"> <!-- 创建一个Bootstrap面板样式为信息面板左边距为5%宽度为80% -->
<div class="panel-heading" align="center"> <!-- 面板头部,居中对齐 -->
<span><%=rs.getString("TITLE") %></span> <!-- 显示公告标题 -->
<span style="margin-right:1%;"><%=rs.getString("PUBLISH_DATE") %></span> <!-- 显示公告发布日期 -->
</div>
<div class="panel-body"> <!-- 面板主体部分 -->
<p style="word-wrap:break-word;"><%=rs.getString("DETAIL") %></p> <!-- 显示公告详情,自动换行 -->
</div>
</div>
<%
}
%>
</div>
</body>
</html>