网站内容管理系统 下载(关于网页的那些事儿,你知道几个?(一))
优采云 发布时间: 2022-02-02 22:06网站内容管理系统 下载(关于网页的那些事儿,你知道几个?(一))
01 系统简介
图书管理系统是一种利用计算机和互联网对图书进行结构化、自动化管理,提高图书管理效率的软件。本系统采用Java+Servlet+Jsp的方式实现基于Web的图书管理系统。
02 开发工具及相关技术2.1 Java技术
Java 是 Sun Microsystems 于 1995 年首次发布的一种编程语言和计算平台。有很多应用程序和网站只有安装了 Java 才能正常工作,而且这样的应用程序和网站也越来越多。Java 快速、安全、可靠。从笔记本电脑到数据中心,从游戏机到科学超级计算机,从手机到互联网,Java 无处不在。
2.2 HTML、css、javascript技术
HTML的全称是Hypertext Marked Language,即超文本标记语言。HTML 是一种标记语言,由 Web 的发明者 Tim Berners-Lee 和同事 Daniel W. Connolly 在 1990 年创建,作为标准通用标记语言 SGML 的应用。用 HTML 编写的超文本文档称为 HTML 文档,它可以独立于各种操作系统平台(如 UNIX、Windows 等)。使用HTML语言,将要表达的信息按照一定的规则写入HTML文件,通过专门的浏览器进行识别,这些HTML文件被“翻译”成可识别的信息,也就是你现在看到的网页。
Cascading Style Sheets(英文全称:Cascading Style Sheets)是一种计算机语言,用于表示HTML(标准通用标记语言的一种应用)或XML(标准通用标记语言的一个子集)等文档样式。CSS不仅可以静态修改网页,还可以用各种脚本语言动态格式化网页的各种元素。CSS 可以对网页中元素位置的布局进行像素级的精确控制,支持几乎所有的字体大小样式,并具有编辑网页对象和模型样式的能力。
JavaScript(简称“JS”)是一种功能优先的轻量级、解释型或即时编译型编程语言。尽管它以开发网页的脚本语言而闻名,但它也用于许多非浏览器环境中。JavaScript 基于原型编程,一种多范式的动态脚本语言,支持面向对象、命令式和声明式(如函数式编程)风格。JavaScript 于 1995 年由 Brendan Eich 在 Netscape Navigator 浏览器上首次设计和实现。由于 Netscape 与 Sun 合作,Netscape 管理层希望它看起来像 Java,因此得名 JavaScript。但实际上它的语法风格更接近于Self和Scheme。JavaScript 的标准是 ECMAScript。截至 2012 年,所有浏览器都完全支持 ECMAScript 5.1,旧版浏览器至少支持 ECMAScript 3 标准。2015 年 6 月 17 日,ECMA International 发布了 ECMAScript 第六版,正式名称为 ECMAScript 2015,但通常被称为 ECMAScript 6 或 ES6。
2.3 Servlet技术
Servlet(Server Applet)是Java Servlet的缩写,称为小型服务程序或服务连接器。用Java编写的服务器端程序具有独立于平台和协议的特点。主要功能是交互浏览和生成数据,生成动态网页内容。
狭义的Servlet是指Java语言实现的接口,广义的Servlet是指实现了Servlet接口的任何类。一般来说,人们将Servlet理解为后者。Servlet 在支持 Java 的应用服务器上运行。原则上,servlet 可以响应任何类型的请求,但在大多数情况下,servlet 仅用于扩展基于 HTTP 协议的 Web 服务器。
2.4 Eclipse 开发工具
Eclipse 是一个开源的、基于 Java 的可扩展开发平台。就其本身而言,它只是一个框架和一组服务,用于通过插件组件构建开发环境。幸运的是,Eclipse 附带了一组标准插件,包括 Java 开发工具包 (JDK)。
2.5 MySql 数据库
MySql是最流行的关系数据库管理系统,而MySQL是WEB应用中最好的RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一。MySql数据库具有以下特点:
Mysql 是开源的,所以不需要额外付费。Mysql 支持大型数据库。可以处理具有数千万条记录的大型数据库。MySQL 使用标准的 SQL 数据语言形式。Mysql 可以在多个系统上被允许,并且支持多种语言。这些编程语言包括 C、C++、Python、Java、Perl、PHP、Eiffel、Ruby 和 Tcl 等。Mysql 对 PHP 有很好的支持,PHP 是目前最流行的 Web 开发语言。MySQL 支持拥有 5000 万条记录的大型数据库和数据仓库。32位系统支持的最大表文件为4GB,64位系统支持的最大表文件为8TB。Mysql可以定制,使用GPL协议,可以修改源代码开发自己的Mysql系统。03 系统功能说明
系统的用户主要有两种:一种是图书馆管理系统的管理员,另一种是普通用户。根据用户类型的不同,系统分为普通用户和管理员,其主要功能如下:
用户终端
在此处插入图像描述
图书查询:根据书号、书名查询图书信息,可以查询书号、书名、分类、作者、价格、图书馆藏书数量。
借阅信息:可查询图书基本信息、借阅日期、还书期限、逾期天数。
借阅历史:查看您过去的借阅历史,包括哪些书籍和其他具体信息。
我的:查看个人信息、修改账号密码、退出系统。
管理员端
在此处插入图像描述
图书管理:根据书号、书名查询图书的基本信息,添加、修改、删除图书。
图书分类管理:根据分类名称查询图书分类信息,添加、修改、删除图书分类。
图书借阅:显示所有借阅图书的信息。
图书归还:显示所有归还图书的信息。
公告管理:向用户发布公告。
读者管理:根据账号、姓名查询读者基本信息,增加、修改、删除读者信息。
我的:查看个人信息、修改账号密码、退出系统。
04 工程结构及其描述
在此处插入图像描述
项目名称:manage_books
包装包装说明:
在此处插入图像描述
05 主要功能详细设计与实现5.1 客户端--图书查询模块
用户访问图书查询模块时,显示当前可以借阅的图书,具有按书名查询图书信息的功能,可以进行图书借阅操作。
在此处插入图像描述
查询函数的servlet代码如下:
package com.cya.controller;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cya.dao.BookDao;
import com.cya.pojo.Book;
/**
* Servlet implementation class selectServlet
*/
@WebServlet("/selectServlet")
public class selectServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public selectServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
//response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
//doGet(request, response);
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
//因为在管理员界面和读者界面都有查找功能,为了将查找的结果返回正确的页面,设置了tip,tip=1表示管理员界面
int tip = Integer.parseInt(request.getParameter("tip"));
String name = request.getParameter("name");
BookDao bookdao = new BookDao();
ArrayList data = bookdao.getLikeList(name);
//将获取的结果存入请求中
request.setAttribute("data", data);
String url = "";
//转发不同的界面
if (tip == 1) {
url = response.encodeURL("/books/admin/admin_books.jsp");
} else {
url = response.encodeURL("/books/user/select.jsp");
}
//将请求转发
request.getRequestDispatcher(url).forward(request, response);
}
}
5.2 客户端--借阅信息模块
当普通用户借完一本书,该模块会自动生成借阅信息,如借阅日期、归还日期等,也可以在该模块归还图书,如下图所示。
在此处插入图像描述
其中,图书返回函数的servlet代码如下:
5.3 管理员--图书馆管理模块
管理员可以通过书号、书名、作者名、出版社等查询图书信息。
在此处插入图像描述
管理员登录系统后,可以添加图书。这是管理员输入信息的主要部分。填写完所有信息后,点击保存按钮,系统将对信息进行处理。界面如下图所示:
在此处插入图像描述
此外,管理员有权修改已添加的图书信息。
在此处插入图像描述
其中,添加图书功能的代码如下:
package com.cya.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cya.dao.BookDao;
/**
* Servlet implementation class AddBookServlet
*/
@WebServlet("/AddBookServlet")
public class AddBookServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public AddBookServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// doGet(request, response);
//设置编码类型
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
//获取要添加图书的信息
String card = request.getParameter("card");
String name = request.getParameter("name");
String type = request.getParameter("type");
String autho = request.getParameter("autho");
String press = request.getParameter("press");
int num = Integer.parseInt(request.getParameter("num"));
BookDao bookdao = new BookDao();
//调用函数,存入图书
bookdao.addBook(card, name, type, autho, press, num);
response.sendRedirect("/manage_books/books/admin/admin_books.jsp");
}
}
5.4 管理员终端--图书分类模块
管理员可以在该界面添加、删除、修改图书分类信息,操作效果如图。
在此处插入图像描述
在此处插入图像描述
修改图书分类功能的代码如下:
package com.cya.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cya.dao.BookDao;
import com.cya.dao.TypeDao;
/**
* Servlet implementation class updateBookTypeServlet
*/
@WebServlet("/updateBookTypeServlet")
public class updateBookTypeServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public updateBookTypeServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// doGet(request, response);
//修改图书类型信息
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
String name = request.getParameter("name");
int tid = Integer.parseInt(request.getParameter("tid"));
TypeDao typedao = new TypeDao();
typedao.updateTypeBook(tid, name);
response.sendRedirect("/manage_books/books/admin/admin_booksType.jsp");
}
}
原文链接:基于Web的图书管理系统系统的设计与实现演示链接:点此查看演示