精华内容
下载资源
问答
  • web前端框架有哪些

    千次阅读 2021-02-27 08:46:28
    前端开发并不难,但是要想做得优雅、健壮并...响应式)(推荐学习:PHP视频教程)时髦、直观并且强大的前端框架,让Web开发变得更加容易。2. Foundation (MIT;响应式)最先进的响应式前端框架。3. 960gs(GPL&MIT;...

    前端开发并不难,但是要想做得优雅、健壮并不容易,使用一个好的前端框架能够帮你很多忙。本文列举了20个优秀的前端框架,供选择使用。

    4df3cf22c574802e33da35b74e0799be.png

    1. Twitter BootStrap (Apache v2.0;响应式)(推荐学习:PHP视频教程)

    时髦、直观并且强大的前端框架,让Web开发变得更加容易。

    2. Foundation (MIT;响应式)

    最先进的响应式前端框架。

    3. 960gs(GPL&MIT;响应式)

    960gs提供了一个简单的网格系统,适合快速开发。

    4. Skeleton(MIT;响应式)

    非常漂亮的Web模板,适合响应式、移动友好的开发。

    5. 99lime HTML KickStart(Free)

    适合网站快速开发的极简HTML构建模块。

    6. Kube(Free;响应式)

    面向专业人员的CSS框架。

    7. Less Framework(MIT;响应式)

    自适应的CSS网格系统。

    8. Flameinwork(Free)

    适合懒人开发者的前端微框架。

    9. G5 Framework(Free)

    (x)HTML5、CSS、PHP前端开发框架。

    10. Easy Framework(Free)

    Easy Framework是一个一体化前端解决方案,分structural、 presentational、interactive三层。

    11. Blueprint(Free)

    一个旨在减少开发时间的前端框架。

    12. YAML(Creative Commons)

    (x)HTML+CSS框架,适合开发现代化浮动布局。

    13. BlueTrip(Free)

    一个功能全面、并且美丽的CSS框架,适合于Blueprint搭配使用。

    14. YUI3:Grids CSS(BSD)

    YUI Grids CSS是最著名的CSS框架之一,是由Yahoo开发小组开发而成。 YUI Grids CSS为开发者提供了预先设置的四种不同页面宽度,六种不同的模板。

    15. 52framework(Creative Commons)

    对HTML5支持非常好,简单易用。

    16. elastiCSS(MIT)

    一个基于Web接口和印刷布局的简单CSS框架。

    17. Emastic(Free)

    一个与众不同的CSS框架。

    18. Fluid 960 Gride System(GPL/MIT)

    Fluid 960 Grid System的模版是根据Nathan Smith之前的作品而创建的。即960 Grid System:传承了MooTools和jQuery JavaScript libraries的效果。

    19. xCSS(MIT)

    一个面向对象的CSS框架,能让你的工作流更加简洁。xCSS基于CSS,可以在开发复杂样式时,提供面向对象的工作流。

    20. EM CSS Framework(MIT/GPL)

    EM CSS Framework提供了一个960px宽 + 12 列网格系统 + CSS的通用样式

    更多PHP相关技术文章,请访问PHP图文教程栏目进行学习!

    展开全文
  • Web应用防护系统的概述(WAF)

    千次阅读 2021-01-19 16:27:10
    Web应用防护系统(也称为:网站应用级入侵防御系统。英文:Web Application Firewall,简称: WAF)。利用国际上公认的一种说法:Web应用防火墙是通过执行一系列针对HTTP/HTTPS的安全策略来专门为Web应用提供保护的...

    前言

    Web应用防护系统(也称为:网站应用级入侵防御系统。英文:Web Application Firewall,简称: WAF)。利用国际上公认的一种说法:Web应用防火墙是通过执行一系列针对HTTP/HTTPS的安全策略来专门为Web应用提供保护的一款产品。

    背景

    当WEB应用越来越为丰富的同时,WEB 服务器以其强大的计算能力、处理性能及蕴含的较高价值逐渐成为主要攻击目标。SQL注入、网页篡改、网页挂马等安全事件,频繁发生。2007年,国家计算机网络应急技术处理协调中心(简称CNCERT/CC)监测到中国大陆被篡改网站总数累积达61228个,比2006年增加了1.5倍。其中,中国大陆政府网站被篡改各月累计达4234个。

    企业等用户一般采用防火墙作为安全保障体系的第一道防线。但是在现实中,Web服务器和应用存在各种各样的安全问题,并随着黑客技术的进步也变得更加难以预防,因为这些问题是普通防火墙难以检测和阻断的,由此产生了WAF(Web应用防护系统)。Web应用防护系统(Web Application Firewall, 简称:WAF)代表了一类新兴的信息安全技术,用以解决诸如防火墙一类传统设备束手无策的Web应用安全问题。与传统防火墙不同,WAF工作在应用层,因此对Web应用防护具有先天的技术优势。基于对Web应用业务和逻辑的深刻理解,WAF对来自Web应用程序客户端的各类请求进行内容检测和验证,确保其安全性与合法性,对非法的请求予以实时阻断,从而对各类网站站点进行有效防护。

    功能

    审计设备

    对于系统自身安全相关的下列事件产生审计记录:

    1. 管理员登录后进行的操作行为;
    2. 对安全策略进行添加、修改、删除等操作行为;
    3. 对管理角色进行增加、删除和属性修改等操作行为;
    4. 对其他安全功能配置参数的设置或更新等行为。

    访问控制设备

    用来控制对Web应用的访问,既包括主动安全模式也包括被动安全模式。

    架构及网络设计工具

    当运行在反向代理模式,他们被用来分配职能,集中控制,虚拟基础结构等。

    WEB应用加固工具

    这些功能增强被保护Web应用的安全性,它不仅能够屏蔽WEB应用固有弱点,而且能够保护WEB应用编程错误导致的安全隐患。需要指出的是,并非每种被称为Web应用防火墙的设备都同时具有以上四种功能。

    同时WEB应用防火墙还具有多面性的特点。比如从网络入侵检测的角度来看可以把WAF看成运行在HTTP层上的IDS设备;从防火墙角度来看,WAF是一种防火墙的功能模块;还有人把WAF看作“深度检测防火墙”的增强。(深度检测防火墙通常工作在的网络的第三层以及更高的层次,而Web应用防火墙则在第七层处理HTTP服务并且更好地支持它。)

    特点

    异常检测协议

    Web应用防火墙会对HTTP的请求进行异常检测,拒绝不符合HTTP标准的请求。并且,它也可以只允许HTTP协议的部分选项通过,从而减少攻击的影响范围。甚至一些Web应用防火墙还可以严格限定HTTP协议中那些过于松散或未被完全制定的选项。

    增强的输入验证

    增强输入验证,可以有效防止网页篡改、信息泄露、木马植入等恶意网络入侵行为。从而减小Web服务器被攻击的可能性。

    及时补丁

    修补Web安全漏洞,是Web应用开发者最头痛的问题,没人会知道下一秒有什么样的漏洞出现,会为Web应用带来什么样的危害。WAF可以为我们做这项工作了——只要有全面的漏洞信息WAF能在不到一个小时的时间内屏蔽掉这个漏洞。当然,这种屏蔽掉漏洞的方式不是万无一失的,并且没有安装对应的补丁本身就是一种安全威胁,但我们在没有选择的情况下,任何保护措施都比没有保护措施更好。

    基于规则的保护和基于异常的保护

    基于规则的保护可以提供各种Web应用的安全规则,WAF生产商会维护这个规则库,并时时为其更新。用户可以按照这些规则对应用进行全方面检测。还有的产品可以基于合法应用数据建立模型,并以此为依据判断应用数据的异常。但这需要对用户企业的应用具有十分透彻的了解才可能做到,可现实中这是十分困难的一件事情。

    状态管理

    WAF能够判断用户是否是第一次访问并且将请求重定向到默认登录页面并且记录事件。通过检测用户的整个操作行为我们可以更容易识别攻击。状态管理模式还能检测出异常事件(比如登陆失败),并且在达到极限值时进行处理。这对暴力攻击的识别和响应是十分有利的。

    其他防护技术

    WAF还有一些安全增强的功能,可以用来解决WEB程序员过分信任输入数据带来的问题。比如:隐藏表单域保护、抗入侵规避技术、响应监视和信息泄露保护。

    配置规则

    打开 /www/server/nginx/waf 目录,里面的 config.lua 文件就是waf防火墙的配置文件 。每一项的具体含义如下所示:

    RulePath=”/www/server/panel/vhost/wafconf/”–waf 详细规则存放目录(一般无需修改)
    
    attacklog =“on”–是否开启攻击日志记录(on 代表开启,off 代表关闭。下同)
    
    logdir =”/www/wwwlogs/waf/”–攻击日志文件存放目录(一般无需修改)
    
    UrlDeny=“on”–是否开启恶意 url 拦截
    
    Redirect=“on”–拦截后是否重定向
    
    CookieMatch=“off”–是否开启恶意Cookie拦截
    
    postMatch=“off”–是否开启 POST 攻击拦截
    
    whiteModule=“on”–是否开启 url 白名单
    
    black_fileExt={“php”,“jsp”}–文件后缀名上传黑名单,如有多个则用英文逗号分隔。如:{“后缀名1”,“后缀名2”,“后缀名3”……}
    
    ipWhitelist={“127.0.0.1”}–白名单 IP,如有多个则用英文逗号分隔。如:
    
    {“127.0.0.1”,“127.0.0.2”,“127.0.0.3”……}下同
    
    ipBlocklist={“1.0.0.1”}–黑名单 IP
    
    CCDeny=“off”–是否开启 CC 攻击拦截
    
    CCrate=“300/60”–CC 攻击拦截阈值,单位为秒。”300/60″代表60秒内如果同一个 IP 访问了300次则拉黑
    
    配置文件中,RulePath 项对应的文件夹里存放的是具体的拦截规则。文件夹下有着相关的规则文件。作用解析如下:
    
    args –GET 参数拦截规则
    
    blockip –无作用
    
    cookie –Cookie拦截规则
    
    denycc –无作用
    
    post –POST 参数拦截规则
    
    returnhtml –被拦截后的提示页面(HTML)
    
    url –url 拦截规则
    
    user-agent –UA 拦截规则
    
    whiteip –无作用
    
    whiteurl –白名单网址
    
    

     

    展开全文
  • 10个基于Web的开源项目管理系统

    千次阅读 2021-02-03 12:22:27
    CodendiCodendi 是一个软件项目协作管理平台,功能配置管理、问题跟踪(bug、任务、需求等)、文档管理,还包含一个Eclipse插件;持续集成接口、报表、测试方案等,基于 LAMP 架构开发,提供了 SOAP Web 接口。该...

    Codendi

    Codendi 是一个软件项目协作管理平台,功能有配置管理、问题跟踪(bug、任务、需求等)、文档管理,还包含一个Eclipse插件;持续集成接口、报表、测试方案等,基于 LAMP 架构开发,提供了 SOAP Web 接口。

    该版本引入了包括一个新的问题跟踪引擎、工作量以及 Git 插件。

    Redmine

    Redmine是一个灵活的项目管理系统,使用 Ruby on Rails 框架开发,跨平台且可以使用多种数据库。

    Redmine概述

    多项目支持

    基于角色的灵活访问控制

    灵活的问题跟踪系统

    甘特图和日历

    新闻、文档和文件管理

    订阅(Feeds)和邮件通知

    为每个项目设置独立Wiki

    为每个项目设置独立讨论区

    简单的时间跟踪功能

    支持为问题、项目和用户增加自定义属性

    集成版本管理系统(SVN, CVS, Mercurial, Bazaar and Darcs)

    支持多种LDAP认证方式

    支持用户自注册

    多语言支持

    多数据库支持

    ProjectPier

    ProjectPier是一款开源的项目管理程序,基于 PHP+MySQL 架构。用户可以通过 ProjectPier 的 web 界面对任务、项目和团队进行管理。ProjectPier 支持多项目和多团队,它帮助团队进行沟通与协作,并通过任务设置、讨论版、里程碑、站内信息等功能使得项目管理更加透明和简单。

    ProjectPier的一些特点包括 :

    多客户的能力,让您管理项目。

    3级权限管理。

    可以限制客户端用户的项目操作权利

    短信和工作清单

    可以管理修改上传文件。

    标签,可用于分类的讯息,任务,目标及档案

    按项目涵盖信息,任务,目标及档案进行全文检索

    隐私:短讯,任务信息等可以进行隐么设置

    Trac

    Trac 是用Python写的一个基于Web的事件跟踪系统,它使用WiKi作为文档的格式,Subversion作为版本控制系统。可帮助开发人员进行源码版本管理、Bug跟踪和讨论。Debian如果你的系统是Debian则用apt-get install trac命令安装即可,Trac依赖的所有软件包系统会自动安装。安装完成后,就可进行配置了。Trac可以设置成Standalone服务器,只供本机使用。也可以与Apache等Web服务器集成,如果与Apache集成,则可配置成CGI、FastCGI或Mod_Python等方式 。

    其他功能:

    项目管理 (Roadmap, Milestones, 等)

    追踪系统 (缺陷追踪、任务 等)

    细粒度权限支持 (自 0.11版本开始)

    最近活动的时间轴

    Wiki

    可定制的报告

    版本控制系统的web接口

    RSS Feeds

    多项目支持

    环境扩展(通过Python 插件支持)

    iCal 输出

    Project HQ

    Project HQ是一个开源协作项目管理工具,类似于Basecamp和activeCollab。Project HQ采用Python, Pylons和SQLAlchemy等开源技术开发并且支持多种数据库。Project HQ使用一个结构化的工作流程协助您管理您的项目。

    Collabtive

    Collabtive是一个基于Web的项目管理系统。提供的功能包括:项目管理,即时聊天工具,任务、文件管理,时间跟踪,多语言支持。

    简单易用

    能管理项目、里程碑、任务

    基线导入

    时间跟踪

    多语言支持

    eGroupWareeGroupware是一个多用户、基于PHP开发的协同工作套件。目前可用的模块包括:电子邮件(IMAP/POP3)、通讯录、行事历、文档管理、书签、Wiki、工作流等

    KForge

    KForge是一个系统的管理软件和知识的项目。它重新使用现有的最佳的工具,如版本控制系统(SVN) ,Bug管理( TRAC )的,和一个wiki (trac或moinmoin ) ,使他们的系统本身的设施(项目,用户,权限等) 。 KForge还提供了一个完整的Web界面的项目管理,以及一个完全开发的插件系统,可以很容易地进行新业务和功能的开发。

    OpenGoo

    OpenGoo是一套基于ExtJs+XAMP(Apache、PHP、MySQL)开发的开源weboffice。适用于任何单位或个人创建,共享,协作维护和发布它们所有内部与外部文档。

    ClockingIT

    一个使用MIT/X Consortium许可协议的项目管理工具, 用来详细记录工作时间,方便项目协调,绘制甘特图,以及提供email提醒。

    展开全文
  • Web——企业信息文档管理系统

    万次阅读 2020-12-30 10:15:00
    Web文档管理系统 欢迎Web文档管理系统 1.开发技术 2.系统总体设计 3.数据存储方案 功能实现 运行结果 测试结果与分析 测试 核心代码 Jsp Java 源代码工程下载 欢迎Web文档管理系统 首先对整体架构进行分析,进而分配...

    欢迎Web文档管理系统

    • 首先对整体架构进行分析,进而分配组员任务,根据案例解决方案将组员合理划分责任,落实功能实现Deadline。
    • 整体系统的前台,也就是普通的用户模式,在用户界面,用户可以通过登陆界面登录,若没有账户,可以选择注册账户,之后选择登录;登陆后可以查找文档并预览所有文件,之后对需要打印的文件选择打印。
    • 整体系统的后台,也就是管理员模式,在管理员界面,管理员可以通过登陆界面登录,但是管理员无法在登陆选择注册管理员注册,默认admin(admin123)账号可以对包括管理员和用户的全部账号进行管理,对用户权限进行管理,对文档类别进行管理,对文档信息进行管理,对文档附件进行管理。
    • 通过Jsp实现上述功能,并且在浏览器端可以对相应功能进行操作。

    1.开发技术

    1. JSP原理:
    • 客户端通过浏览器向服务器发出请求,在该请求中包含了请求的资源的路径,这样当服务器接收到该请求后就可以知道被请求的内容。
    • 服务器根据接收到的客户端的请求来加载相应的JSP文件。
    • Web服务器Tomcat9.1.04中的JSP引擎会将被加载的JSP文件转化为Servlet。
    • JSP引擎将生成的Servlet代码编译成Class文件。服务器Tomcat9.1.04执行这个Class文件,最后服务器将执行结果发送给浏览器进行显示。
    1. 程序开发环境和开发语言
    • 开发环境方面

    运行VMware 15.5.0 虚拟机,配置内存4GB,单核4线程
    Window 10企业版LTSC x64
    JDK 11.0.4 windows-x64
    IntelliJ IDEA 2020.1 x64
    Mysql 5.1.55
    Navicat 10.0.11
    Tomcat 9.0.41
    Firefox 84.0.1 x64
    Google Chrome 87.0.4280.88 x64
    Enterprise Architect 12.0.1209

    • 开发语言方面,

    基于IntelliJ IDEA强大功能,进行Java,HTML,CSS等编写和调用。团队合作时。
    前端页面编写用到HbuilderX等HTML编写工具进行HTML编写和CSS渲染。

    2.系统总体设计

    在这里插入图片描述

    3.数据存储方案

    • 数据通过Mysql数据库,引擎采用InnoDB
    • 创建“document”库,并建立相对应的表
      在这里插入图片描述
    /*!40101 SET NAMES utf8 */;
    
    /*!40101 SET SQL_MODE=''*/;
    
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    
    CREATE DATABASE /*!32312 IF NOT EXISTS*/`document` /*!40100 DEFAULT CHARACTER SET utf8 */;
    
    USE `document`;
    
    
    DROP TABLE IF EXISTS `document_attachment`;
    CREATE TABLE `document_attachment`  (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(255) DEFAULT NULL,
      `path` varchar(255) DEFAULT NULL,
      `size` int(11) DEFAULT NULL,
      `document_id` int(11) DEFAULT NULL,
      PRIMARY KEY (`id`) 
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
    
    
    DROP TABLE IF EXISTS `document_category`;
    CREATE TABLE `document_category`  (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(255) DEFAULT NULL,
      PRIMARY KEY (`id`) 
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
    
    DROP TABLE IF EXISTS `document_info`;
    CREATE TABLE `document_info`  (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(255) DEFAULT NULL,
      `content` varchar(255) DEFAULT NULL,
      `document_category` varchar(255)DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
    
    
    DROP TABLE IF EXISTS `user_info`;
    CREATE TABLE `user_info`  (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `username` varchar(255) DEFAULT NULL,
      `password` varchar(255) DEFAULT NULL,
      `user_permissions` varchar(255)DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
    
    
    DROP TABLE IF EXISTS `user_permissions`;
    CREATE TABLE `user_permissions`  (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `user_permissions` varchar(255)DEFAULT NULL,
      PRIMARY KEY (`id`) 
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    

    4.功能实现

    1. 系统注册登录
    • 用户注册登录模块实现用户注册登录功能,企业员工用户登录后,能查看相关文档信息和打印文档信息等;管理员用户登录系统后,能通过后台对系统进行维护和管理,主要包括用户角色管理,文档类别管理和文档信息管理等。
    • 首先会根据用户输入的账号和密码,在LoginServlet中获取对应参数,并进行查表获取用户信息。如果用户信息错误,则返回“用户名或者密码错误”相应提示。如果用户信息正确,则根据用户类型来判断是管理员还是普通用户,从而跳转到不同首页。管理员则跳转到后台管理首页,非管理员则跳转到前台首页。
    1. 文档类别管理
    • 文档类别管理模块实现对文档类别的管理,主要包括文档类别的添加,修改和删除。
    1. 文档信息管理
    • 文档信息管理模块实现对文档信息的管理功能,主要包括对文档进行添加,修改,删除,查看和文档的浏览功能等。
    1. 文档信息查询
    • 文档信息查询模块实现对文档的综合查询功能,主要包括按文档类别查询,按文档标题查询,模糊匹配查询等。
    1. 文档附件管理
    • 文档附件管理模块实现对文档附件的管理功能。主要包括对文件的添加,编辑和删除。

    5.运行结果

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    测试结果与分析

    • 首先打开IntelliJ IDEA,之后进行Tomcat配置,Jar配置等
    • 环境配置成功后开始debug程序,等待Tomcat显示绿色后,Web exploded显示绿色对号后,进行访问地址:http://localhost:8080/Document_Sys_Web_exploded/front/login.jsp,便可以进入文档管理系统的登陆界面,在界面中可以选择已知的用户或者管理员账号和密码进行登录,如果没有账号,点击“点击注册”超链接进入注册界面进行注册,注册成功后自动跳转至登陆界面进行登录。
    • 用户界面可以查找文件和浏览打印文件。
    • 管理员账号admin(admin123)进行用户信息,用户权限,文档类别,文档信息,文档附件的增删改操作。
    • 整套系统反馈延时低于用户最大等待时间,SQL语句简洁干练,尽可能保证在不提高空间复杂度的条件下降低整体系统的时间复杂度。

    测试

    在测试中,进行路径覆盖测试:

    操作步骤输入数据期望结果
    点击注册,在用户名后文本框内输入用户名,在密码后文本框内输入密码,点击注册后,跳转到登录界面进行登录自定义用户名,自定义密码显示注册成功,并进入用户页面
    在用户名后文本框内输入admin,在密码后文本框内输入admin123,进行登录对应的用户名,对应的密码登录Admin后台界面
    依次点击管理员后台按钮和用户前台按钮正确用户名和对应密码操作成功!

    6.核心代码

    Jsp

    • index
    <%@ page import="model.UserInfo" %>
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.DocumentInfoMapper" %>
    <%@ page import="model.DocumentInfo" %>
    <%@ page import="java.util.List" %><%--
      Created by IntelliJ IDEA.
      User: GodOuO
      Date: 2020/12/27
      Time: 20:20
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>用户首页</title>
        <style>
            body{
                background: url("../images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: #cc0;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <h1>文档管理系统-User</h1>
    <div>
    
        <form action="<%=request.getContextPath()%>/front/index.jsp">
            <%
                UserInfo user = (UserInfo) session.getAttribute("user");
                if (user != null) {
                    out.write("<span>" + user.getUsername() + "</span>\n" +
                            "<span><a href=\"" + request.getContextPath() + "/logout\">退出登录</a></span>");
                } else {
                    out.write("<a href=\"" + request.getContextPath() + "/front/login.jsp\">登录</a>\n" +
                            " /\n" +
                            " <a href=\"" + request.getContextPath() + "/front/register.jsp\">注册</a>");
                }
            %>
            <%
                String name = request.getParameter("name");
                DocumentInfo book = new DocumentInfo();
                book.setName(name);
                List<DocumentInfo> search = DocumentInfoMapper.search(book);
            %>
            <span style="padding-right: 50px"></span>
            <input type="text" placeholder="请输入名称..." value="" name="name">
            <button type="submit">搜索</button>
        </form>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table border="1" style="margin: auto;">
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>内容</th>
                <th>文档类别</th>
                <th>操作</th>
            </tr>
            <c:forEach items="<%=search%>" var="b">
                <tr>
                    <td>${b.id}</td>
                    <td>${b.name}</td>
                    <td>${b.content}</td>
                    <td>合同</td>
                    <td>
                        <button >打印</button>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
    </body>
    </html>
    
    
    • login
    <%--
      Created by IntelliJ IDEA.
      User: GodOuO
      Date: 2020/12/25
      Time: 20:38
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>登录</title>
        <style>
            body{
                background: url("../images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        tr.td{
            width: 20%;
            text-align: right;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            padding-right: 10px;
            margin-top: 10px;
            color: #888
        }
        a:visited{
            text-decoration:none;   //去除下划线
            background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
        .div0{
            position:absolute;
               /*定位方式绝对定位absolute*/
            top:50%;
            left:50%;
            /*顶和高同时设置50%实现的是同时水平垂直居中效果*/
            transform:translate(-50%,-50%);
            /*实现块元素百分比下居中*/
            width:450px;
            padding:50px;
            background: rgba(255,255,255,.3);
            /*背景颜色为白色,透明度为0.8*/
            box-sizing:border-box;
            /*box-sizing设置盒子模型的解析模式为怪异盒模型,
    24     将border和padding划归到width范围内*/
            box-shadow: 0px 15px 25px rgba(0,0,0,0.5);
            /*边框阴影  水平阴影0 垂直阴影15px 模糊25px 颜色黑色透明度0.5*/
            border-radius:15px;
            /*边框圆角,四个角均为15px*/
        }
        .div2{
            margin-left: 500px;
        }
    </style>
    <h1>文档管理系统登录</h1>
    <br>
    <div class="div0">
        <form action="<%=request.getContextPath()%>/login" method="post">
                <div class="div1">
                    用户名:
                    <input type="text" placeholder="用户名" name="username" value="">
                </div>
                <div class="div1">&emsp;码:
                    <input type="password" placeholder="密码" name="password" value="">
                </div>
            <br>
                        <button type="submit">登录</button>
                        <button type="reset">重置</button>
             <br>
                    没有账户?<a href="<%=request.getContextPath()%>/front/register.jsp">点击注册</a>
                 <span style="color: red">${sessionScope.error}</span></td>
    
        </form>
    </div>
    </body>
    </html>
    <%
        session.removeAttribute("error");
    %>
    
    • register
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>注册</title>
        <style>
            body{
                background: url("../images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        tr.td{
            width: 20%;
            text-align: right;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            padding-right: 10px;
            margin-top: 10px;
            color: #888
        }
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <h1>文档管理系统注册账号</h1>
    
    <br>
    <div>
        <form action="<%=request.getContextPath()%>/register" method="post">
            <table style="margin: auto">
                <tr>
                    <td>用户名:</td>
                    <td><input type="text" placeholder="用户名" name="username" value=""></td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td><input type="password" placeholder="密码" name="password" value=""></td>
                </tr>
                <tr>
                    <td>确认:</td>
                    <td><input type="password" placeholder="密码" value=""></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">注册</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>已有账号?<a href="<%=request.getContextPath()%>/front/login.jsp">点击登录</a></td>
                </tr>
                <tr>
                    <td><span style="color: red">${sessionScope.error}</span></td>
                </tr>
            </table>
        </form>
    </div>
    </body>
    </html>
    <%
    session.removeAttribute("error");
    %>
    
    
    • DocumentAttachment
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.DocumentAttachmentMapper" %>
    <%@ page import="model.DocumentAttachment" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentAttachment</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*标悬停时背景颜色变橙*/
    
    </style>
    <h1>文档附件管理</h1>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/DocumentAttachmentAdd.jsp">
            <button>添加</button>
        </a>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table style="margin: auto;">
            <tr>
                <td>
                    <jsp:include page="spider.jsp"/>
                </td>
                <td><span style="padding-right: 30px"></span></td>
                <td>
                    <table border="1" style="margin: auto;">
                        <tr>
    <th>ID</th>
    <th>名称</th>
    <th>路径</th>
    <th>大小</th>
    <th>文档ID</th>
                            <th>操作</th>
                        </tr>
                        <%
                            for (DocumentAttachment temp : DocumentAttachmentMapper.list()) {
                                out.write("<tr>\n" +
                                        "                        <td>" + temp.getId() + "</td>\n" +
                                        "                        <td>" + temp.getName() + "</td>\n" +
                                        "                        <td>" + temp.getPath() + "</td>\n" +
                                        "                        <td>" + temp.getSize() + "</td>\n" +
                                        "                        <td>" + temp.getDocumentId() + "</td>\n" +
                                        "                        <td>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentAttachment?method=getById&id=" + temp.getId() + "><button>编辑</button></a>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentAttachment?method=deleteById&id=" + temp.getId() + "><button>删除</button></a>\n" +
                                        "                        </td>\n" +
                                        "                    </tr>");
                            }
                        %>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </body>
    </html>
    
    
    • DocumentAttachmentAdd
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentAttachmentAdd</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <h1>文档附件添加</h1>
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/index.jsp">
            <button>返回</button>
        </a>
    </div>
    <hr>
    <br>
    <c:if test="${sessionScope.documentAttachment==null}">
    <form action="<%=request.getContextPath()%>/documentAttachment?method=addBean" method="post">
        </c:if>
        <c:if test="${sessionScope.documentAttachment!=null}">
        <form action="<%=request.getContextPath()%>/documentAttachment?method=updateById" method="post">
            </c:if>    <table style="margin: auto">            <tr>
                    <td>ID</td>
                    <td><input type="text" prefix="ID" name="id" value="${sessionScope.documentAttachment.id}"></td>
                </tr>
                <tr>
                    <td>名称:</td>
                    <td><input type="text" prefix="名称" name="name" value="${sessionScope.documentAttachment.name}"></td>
                </tr>
                <tr>
                    <td>路径:</td>
                    <td><input type="text" prefix="路径" name="path" value="${sessionScope.documentAttachment.path}"></td>
                </tr>
                <tr>
                    <td>大小:</td>
                    <td><input type="text" prefix="大小" name="size" value="${sessionScope.documentAttachment.size}"></td>
                </tr>
                <tr>
                    <td>文档ID</td>
                    <td><input type="text" prefix="文档ID" name="documentId" value="${sessionScope.documentAttachment.documentId}"></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">添加</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
        </table>
    </form>
    </body>
    </html>
    <%
    session.removeAttribute("documentAttachment");
    %>
    
    • DocumentCategory
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.DocumentCategoryMapper" %>
    <%@ page import="model.DocumentCategory" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentCategory</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    
    <body style="text-align:center;">
    <h1>文档类别管理</h1>
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/DocumentCategoryAdd.jsp">
            <button>添加</button>
        </a>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table style="margin: auto;">
            <tr>
                <td>
                    <jsp:include page="spider.jsp"/>
                </td>
                <td><span style="padding-right: 30px"></span></td>
                <td>
                    <table border="1" style="margin: auto;">
                        <tr>
    <th>ID</th>
    <th>类别名称</th>
                            <th>操作</th>
                        </tr>
                        <%
                            for (DocumentCategory temp : DocumentCategoryMapper.list()) {
                                out.write("<tr>\n" +
                                        "                        <td>" + temp.getId() + "</td>\n" +
                                        "                        <td>" + temp.getName() + "</td>\n" +
                                        "                        <td>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentCategory?method=getById&id=" + temp.getId() + "><button>编辑</button></a>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentCategory?method=deleteById&id=" + temp.getId() + "><button>删除</button></a>\n" +
                                        "                        </td>\n" +
                                        "                    </tr>");
                            }
                        %>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </body>
    </html>
    
    
    • DocumentCategoryAdd
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentCategoryAdd</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <h1>文档类别添加</h1>
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/index.jsp">
            <button>返回</button>
        </a>
    </div>
    <hr>
    <br>
    <c:if test="${sessionScope.documentCategory==null}">
    <form action="<%=request.getContextPath()%>/documentCategory?method=addBean" method="post">
        </c:if>
        <c:if test="${sessionScope.documentCategory!=null}">
        <form action="<%=request.getContextPath()%>/documentCategory?method=updateById" method="post">
            </c:if>    <table style="margin: auto">            <tr>
                    <td>ID</td>
                    <td><input type="text" prefix="ID" name="id" value="${sessionScope.documentCategory.id}"></td>
                </tr>
                <tr>
                    <td>类别名称:</td>
                    <td><input type="text" prefix="类别名称" name="name" value="${sessionScope.documentCategory.name}"></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">添加</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
        </table>
    </form>
    </body>
    </html>
    <%
    session.removeAttribute("documentCategory");
    %>
    
    • DocumentInfo
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.DocumentInfoMapper" %>
    <%@ page import="model.DocumentInfo" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentInfo</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: lightsteelblue;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <h1>文档信息管理</h1>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/DocumentInfoAdd.jsp">
            <button>添加</button>
        </a>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table style="margin: auto;">
            <tr>
                <td>
                    <jsp:include page="spider.jsp"/>
                </td>
                <td><span style="padding-right: 30px"></span></td>
                <td>
                    <table border="1" style="margin: auto;">
                        <tr>
    <th>ID</th>
    <th>名称</th>
    <th>内容</th>
    <th>文档类别</th>
                            <th>操作</th>
                        </tr>
                        <%
                            for (DocumentInfo temp : DocumentInfoMapper.list()) {
                                out.write("<tr>\n" +
                                        "                        <td>" + temp.getId() + "</td>\n" +
                                        "                        <td>" + temp.getName() + "</td>\n" +
                                        "                        <td>" + temp.getContent() + "</td>\n" +
                                        "                        <td>" + temp.getDocumentCategory() + "</td>\n" +
                                        "                        <td>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentInfo?method=getById&id=" + temp.getId() + "><button>编辑</button></a>\n" +
                                        "                            <a href=" + request.getContextPath() + "/documentInfo?method=deleteById&id=" + temp.getId() + "><button>删除</button></a>\n" +
                                        "                        </td>\n" +
                                        "                    </tr>");
                            }
                        %>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </body>
    </html>
    
    
    • DocumentInfoAdd
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>DocumentInfoAdd</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: #cc0;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background: cornflowerblue;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <h1>文档信息添加</h1>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/index.jsp">
            <button>返回</button>
        </a>
    </div>
    <hr>
    <br>
    <c:if test="${sessionScope.documentInfo==null}">
    <form action="<%=request.getContextPath()%>/documentInfo?method=addBean" method="post">
        </c:if>
        <c:if test="${sessionScope.documentInfo!=null}">
        <form action="<%=request.getContextPath()%>/documentInfo?method=updateById" method="post">
            </c:if>    <table style="margin: auto">            <tr>
                    <td>ID</td>
                    <td><input type="text" prefix="ID" name="id" value="${sessionScope.documentInfo.id}"></td>
                </tr>
                <tr>
                    <td>名称:</td>
                    <td><input type="text" prefix="名称" name="name" value="${sessionScope.documentInfo.name}"></td>
                </tr>
                <tr>
                    <td>内容:</td>
                    <td><input type="text" prefix="内容" name="content" value="${sessionScope.documentInfo.content}"></td>
                </tr>
                <tr>
                    <td>文档类别:</td>
                    <td><input type="text" prefix="文档类别" name="documentCategory" value="${sessionScope.documentInfo.documentCategory}"></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">添加</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
        </table>
    </form>
    </body>
    </html>
    <%
    session.removeAttribute("documentInfo");
    %>
    
    • index
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    
    <jsp:include page="UserInfo.jsp"/>
    
    
    • spider
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <style>
            font{
                color: black;
            }
        </style>
    </head>
    <body>
    <li><a href="<%=request.getContextPath()%>/UserInfo.jsp"><font>用户信息管理</font></a></li>
    <li><a href="<%=request.getContextPath()%>/UserPermissions.jsp"><font>用户权限管理</font></a></li>
    <li><a href="<%=request.getContextPath()%>/DocumentCategory.jsp"><font>文档类别管理</font></a></li>
    <li><a href="<%=request.getContextPath()%>/DocumentInfo.jsp"><font>文档信息管理</font></a></li>
    <li><a href="<%=request.getContextPath()%>/DocumentAttachment.jsp"><font>文档附件管理</font></a></li>
    </body>
    </html>
    
    
    
    • UserInfo
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.UserInfoMapper" %>
    <%@ page import="model.UserInfo" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>UserInfo</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    
    <body style="text-align:center;">
    <style type="text/css">
    
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5f5a4b, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            background-clip: padding-box; /*背景被裁剪到内边距框*/
            position:relative;
            height: 25px;
            line-height: 25px;
            text-align: center;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  /*鼠标悬停时背景颜色变橙*/
    
    </style>
    <h1>用户信息管理</h1>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/UserInfoAdd.jsp">
            <button>添加</button>
        </a>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table style="margin: auto;">
            <tr>
                <td>
                    <jsp:include page="spider.jsp"/>
                </td>
                <td><span style="padding-right: 30px"></span></td>
                <td>
                    <table border="1" style="margin: auto;">
                        <tr>
    
                            <th>ID</th>
                            <th>姓名</th>
                            <th>密码</th>
                            <th>用户权限</th>
                                <th>操作</th>
                        </tr>
                        <%
                            for (UserInfo temp : UserInfoMapper.list()) {
                                out.write("<tr>\n" +
                                        "                        <td>" + temp.getId() + "</td>\n" +
                                        "                        <td>" + temp.getUsername() + "</td>\n" +
                                        "                        <td>" + temp.getPassword() + "</td>\n" +
                                        "                        <td>" + temp.getUserPermissions() + "</td>\n" +
                                        "                        <td>\n" +
                                        "                            <a href=" + request.getContextPath() + "/userInfo?method=getById&id=" + temp.getId() + "><button>编辑</button></a>\n" +
                                        "                            <a href=" + request.getContextPath() + "/userInfo?method=deleteById&id=" + temp.getId() + "><button>删除</button></a>\n" +
                                        "                        </td>\n" +
                                        "                    </tr>");
                            }
                        %>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </body>
    </html>
    
    • UserInfoAdd
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>UserInfoAdd</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <h1>用户信息添加</h1>
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  //鼠标悬停时背景颜色变橙
    
    </style>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/index.jsp">
            <button>返回</button>
        </a>
    </div>
    <hr>
    <br>
    <c:if test="${sessionScope.userInfo==null}">
    <form action="<%=request.getContextPath()%>/userInfo?method=addBean" method="post">
        </c:if>
        <c:if test="${sessionScope.userInfo!=null}">
        <form action="<%=request.getContextPath()%>/userInfo?method=updateById" method="post">
            </c:if>    <table style="margin: auto">            <tr>
                    <td>ID</td>
                    <td><input type="text" prefix="ID" name="id" value="${sessionScope.userInfo.id}"></td>
                </tr>
                <tr>
                    <td>姓名:</td>
                    <td><input type="text" prefix="姓名" name="username" value="${sessionScope.userInfo.username}"></td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td><input type="text" prefix="密码" name="password" value="${sessionScope.userInfo.password}"></td>
                </tr>
                <tr>
                    <td>用户权限:</td>
                    <td><input type="text" prefix="用户权限" name="userPermissions" value="${sessionScope.userInfo.userPermissions}"></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">添加</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
        </table>
    </form>
    </body>
    </html>
    <%
    session.removeAttribute("userInfo");
    %>
    
    • UserPermissions
    <%@ page import="cn.hutool.core.util.StrUtil" %>
    <%@ page import="mapper.UserPermissionsMapper" %>
    <%@ page import="model.UserPermissions" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>UserPermissions</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    
    <body style="text-align:center;">
    <h1>用户权限管理</h1>
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            background-clip: padding-box; /*背景被裁剪到内边距框*/
            position:relative;
            height: 25px;
            line-height: 25px;
            text-align: center;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  //鼠标悬停时背景颜色变橙
    
    </style>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/UserPermissionsAdd.jsp">
            <button>添加</button>
        </a>
    </div>
    <hr>
    <br>
    <div style="text-align: center;">
        <table style="margin: auto;">
            <tr>
                <td>
                    <jsp:include page="spider.jsp"/>
                </td>
                <td><span style="padding-right: 30px"></span></td>
                <td>
                    <table border="1" style="margin: auto;">
                        <tr>
    <th>ID</th>
    <th>用户权限</th>
                            <th>操作</th>
                        </tr>
                        <%
                            for (UserPermissions temp : UserPermissionsMapper.list()) {
                                out.write("<tr>\n" +
                                        "                        <td>" + temp.getId() + "</td>\n" +
                                        "                        <td>" + temp.getUserPermissions() + "</td>\n" +
                                        "                        <td>\n" +
                                        "                            <a href=" + request.getContextPath() + "/userPermissions?method=getById&id=" + temp.getId() + "><button>编辑</button></a>\n" +
                                        "                            <a href=" + request.getContextPath() + "/userPermissions?method=deleteById&id=" + temp.getId() + "><button>删除</button></a>\n" +
                                        "                        </td>\n" +
                                        "                    </tr>");
                            }
                        %>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </body>
    </html>
    
    
    • UserPermissionsAdd
    
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored="false" %>
    <html>
    <head>
        <title>UserPermissionsAdd</title>
        <style>
            body{
                background: url("images/4.jpg");
                background-size: 100%;
                background-size: cover;
            }
        </style>
    </head>
    <body style="text-align:center;">
    <style type="text/css">
        h1{
            background: #2B6695;
            border-radius: 6px 6px 6px 6px;
            box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
            color: #FFFFFF;
            font-family:"微软雅黑", "宋体", "黑体", Arial;
            font-size: 18px;
            font-weight: bold;
            height: 25px;
            line-height: 25px;
            margin: 18px 0 !important;
            padding: 8px 0 5px 5px;
            text-shadow: 2px 2px 3px #222222;
        }
        button{
            background:-webkit-linear-gradient(top ,rgb(169,169,169),rgb(34,102,149) 50%,rgb(34,102,140) 50%,rgb(128,128,128) 100%);
            display:inline-block;
            border:rgb(169,169, 187) solid 1px;
            box-shadow:inset rgba(255,255,255,1.0) 0px 0px 2px 0px;
            border-radius:8px;
            outline:none;
            width:45px;
            height:20px;
            cursor:pointer;
            color:#ffffff;
            font-size:10px;
        }
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: cornflowerblue;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;}
        a:visited{
            text-decoration:none;   //去除下划线
        background-color: purple;
            color:gray;
        }
        a:hover{
            background-color: orange;
        }  //鼠标悬停时背景颜色变橙
    
    </style>
    <h1>用户权限添加</h1>
    <div>
        <span>${sessionScope.user.username}</span>
        <span><a href="<%=request.getContextPath()%>/logout">退出登录</a></span>
        <span style="padding-right: 50px"></span>
        <a href="<%=request.getContextPath()%>/index.jsp">
            <button>返回</button>
        </a>
    </div>
    <hr>
    <br>
    <c:if test="${sessionScope.userPermissions==null}">
    <form action="<%=request.getContextPath()%>/userPermissions?method=addBean" method="post">
        </c:if>
        <c:if test="${sessionScope.userPermissions!=null}">
        <form action="<%=request.getContextPath()%>/userPermissions?method=updateById" method="post">
            </c:if>    <table style="margin: auto">            <tr>
                    <td>ID</td>
                    <td><input type="text" prefix="ID" name="id" value="${sessionScope.userPermissions.id}"></td>
                </tr>
                <tr>
                    <td>用户权限:</td>
                    <td><input type="text" prefix="用户权限" name="userPermissions" value="${sessionScope.userPermissions.userPermissions}"></td>
                </tr>
                <tr>
                    <td>
                        <button type="submit">添加</button>
                    </td>
                    <td>
                        <button type="reset">重置</button>
                    </td>
                </tr>
        </table>
    </form>
    </body>
    </html>
    <%
    session.removeAttribute("userPermissions");
    %>
    

    Java

    • JDBCUtils
    package utils;
    
    
    import java.io.IOException;
    import java.io.InputStream;
    import java.sql.*;
    import java.util.Properties;
    
    /**
     * JDBC 工具类
     */
    public class JDBCUtils {
        private static String url;
        private static String user;
        private static String password;
        private static String driver;
    
        /**
         * 文件读取,只会执行一次,使用静态代码块
         */
        static {
            //读取文件,获取值
            try {
                //1.创建Properties集合类
                Properties pro = new Properties();
                //获取src路径下的文件--->ClassLoader类加载器
                ClassLoader classLoader = JDBCUtils.class.getClassLoader();
                InputStream resourceAsStream = classLoader.getResourceAsStream("jdbc.properties");
                //2.加载文件
                pro.load(resourceAsStream);
                //3获取数据
                url = pro.getProperty("dataSource.jdbcUrl");
                user = pro.getProperty("dataSource.username");
                password = pro.getProperty("dataSource.password");
                driver = pro.getProperty("dataSource.driverClass");
                //4.注册驱动
                Class.forName(driver);
                resourceAsStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
    
        /**
         * 获取连接
         *
         * @return 连接对象
         */
        public static Connection getConnection() throws SQLException {
            Connection conn = DriverManager.getConnection(url, user, password);
            return conn;
        }
    
        /**
         * 释放资源
         */
        public static void close(ResultSet rs, Statement st, Connection conn) {
            if (rs != null) {
                try {
                    rs.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            if (st != null) {
                try {
                    st.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    
        public static void close(Statement st, Connection conn) {
            if (st != null) {
                try {
                    st.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    }
    
    dataSource.driverClass=com.mysql.jdbc.Driver
    dataSource.jdbcUrl=jdbc:mysql://localhost:3306/document?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
    dataSource.username=root
    dataSource.password=***
    
    • EncodingFilter
    package filter;
    
    import javax.servlet.*;
    import java.io.IOException;
    
    public class EncodingFilter implements Filter {
    
        private String charEncoding = null;
    
        public EncodingFilter() {
        }
    
        /**
         * @see Filter#init(FilterConfig)
         */
        public void init(FilterConfig fConfig) throws ServletException {
            charEncoding = fConfig.getInitParameter("charEncoding");
            if (charEncoding == null || charEncoding.equals("null")) {
                throw new ServletException("EncodingFilter中的编码设置为空");
            }
        }
    
        /**
         * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
         */
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
            // 将设置的编码与请求的编码进行比较,若不同,则将请求的编码设置为设置的编码
            if (!charEncoding.equals(request.getCharacterEncoding())) {
                request.setCharacterEncoding(charEncoding);
            }
            // 将相应的编码设置为设置的编码
            response.setCharacterEncoding(charEncoding);
            chain.doFilter(request, response);
    
        }
    
        /**
         * @see Filter#destroy()
         */
        public void destroy() {
            // TODO Auto-generated method stub
        }
    }
    
    • DocumentAttachmentMapper
    package mapper;
    
    import org.springframework.jdbc.mapper.MapperUtils;
    import model.DocumentAttachment;
    import java.util.List;
    import utils.JDBCUtils;
    import java.util.ArrayList;
    import java.sql.*;
    
    public class DocumentAttachmentMapper {
        public static List<DocumentAttachment> list() throws Exception{
           return  list(null);
        }
    
        public static List<DocumentAttachment> list(DocumentAttachment DocumentAttachment)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_attachment";
            sql += MapperUtils.getEqualCondition(DocumentAttachment);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (Exception throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentAttachment> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentAttachment temp = new DocumentAttachment();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
                    temp.setPath(resultSet.getString("path"));
                    temp.setSize(resultSet.getInt("size"));
                    temp.setDocumentId(resultSet.getInt("document_id"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static List<DocumentAttachment> search(DocumentAttachment documentAttachment)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_attachment";
            sql += MapperUtils.getLikeCondition(documentAttachment);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentAttachment> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentAttachment temp = new DocumentAttachment();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
                    temp.setPath(resultSet.getString("path"));
                    temp.setSize(resultSet.getInt("size"));
                    temp.setDocumentId(resultSet.getInt("document_id"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;        } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    
    
        public static boolean add(DocumentAttachment documentAttachment) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "insert into document_attachment(id,name,path,size,document_id) values (NULL,?,?,?,?)";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                preparedStatement.setString(1, documentAttachment.getName());
                preparedStatement.setString(2, documentAttachment.getPath());
                preparedStatement.setInt(3, documentAttachment.getSize());
                preparedStatement.setInt(4, documentAttachment.getDocumentId());
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static boolean deleteById(Integer id)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "delete from document_attachment where id=" + id;
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static int updateById(Integer id, DocumentAttachment documentAttachment) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "update document_attachment set ";
            sql += MapperUtils.getUpdateCondition(documentAttachment);
            sql += " where id = '" + id + "'";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.executeUpdate();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    }
    
    • DocumentCategoryMapper
    package mapper;
    
    import org.springframework.jdbc.mapper.MapperUtils;
    import model.DocumentCategory;
    import java.util.List;
    import utils.JDBCUtils;
    import java.util.ArrayList;
    import java.sql.*;
    
    public class DocumentCategoryMapper {
        public static List<DocumentCategory> list() throws Exception{
           return  list(null);
        }
    
        public static List<DocumentCategory> list(DocumentCategory DocumentCategory)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_category";
            sql += MapperUtils.getEqualCondition(DocumentCategory);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (Exception throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentCategory> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentCategory temp = new DocumentCategory();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static List<DocumentCategory> search(DocumentCategory documentCategory)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_category";
            sql += MapperUtils.getLikeCondition(documentCategory);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentCategory> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentCategory temp = new DocumentCategory();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;        } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    
    
        public static boolean add(DocumentCategory documentCategory) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "insert into document_category(id,name) values (NULL,?)";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                preparedStatement.setString(1, documentCategory.getName());
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static boolean deleteById(Integer id)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "delete from document_category where id=" + id;
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static int updateById(Integer id, DocumentCategory documentCategory) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "update document_category set ";
            sql += MapperUtils.getUpdateCondition(documentCategory);
            sql += " where id = '" + id + "'";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.executeUpdate();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    }
    
    • DocumentInfoMapper
    package mapper;
    
    import org.springframework.jdbc.mapper.MapperUtils;
    import model.DocumentInfo;
    import java.util.List;
    import utils.JDBCUtils;
    import java.util.ArrayList;
    import java.sql.*;
    
    public class DocumentInfoMapper {
        public static List<DocumentInfo> list() throws Exception{
           return  list(null);
        }
    
        public static List<DocumentInfo> list(DocumentInfo DocumentInfo)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_info";
            sql += MapperUtils.getEqualCondition(DocumentInfo);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (Exception throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentInfo> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentInfo temp = new DocumentInfo();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
                    temp.setContent(resultSet.getString("content"));
                    temp.setDocumentCategory(resultSet.getString("document_category"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static List<DocumentInfo> search(DocumentInfo documentInfo)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from document_info";
            sql += MapperUtils.getLikeCondition(documentInfo);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<DocumentInfo> list = new ArrayList<>();
                while (resultSet.next()) {
                    DocumentInfo temp = new DocumentInfo();
                    temp.setId(resultSet.getInt("id"));
                    temp.setName(resultSet.getString("name"));
                    temp.setContent(resultSet.getString("content"));
                    temp.setDocumentCategory(resultSet.getString("document_category"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;        } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    
    
        public static boolean add(DocumentInfo documentInfo) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "insert into document_info(id,name,content,document_category) values (NULL,?,?,?)";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                preparedStatement.setString(1, documentInfo.getName());
                preparedStatement.setString(2, documentInfo.getContent());
                preparedStatement.setString(3, documentInfo.getDocumentCategory());
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static boolean deleteById(Integer id)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "delete from document_info where id=" + id;
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static int updateById(Integer id, DocumentInfo documentInfo) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "update document_info set ";
            sql += MapperUtils.getUpdateCondition(documentInfo);
            sql += " where id = '" + id + "'";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.executeUpdate();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    }
    
    • UserInfoMapper
    package mapper;
    
    import org.springframework.jdbc.mapper.MapperUtils;
    import model.UserInfo;
    import java.util.List;
    import utils.JDBCUtils;
    import java.util.ArrayList;
    import java.sql.*;
    
    public class UserInfoMapper {
        public static List<UserInfo> list() throws Exception{
           return  list(null);
        }
    
        public static List<UserInfo> list(UserInfo UserInfo)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from user_info";
            sql += MapperUtils.getEqualCondition(UserInfo);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (Exception throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<UserInfo> list = new ArrayList<>();
                while (resultSet.next()) {
                    UserInfo temp = new UserInfo();
                    temp.setId(resultSet.getInt("id"));
                    temp.setUsername(resultSet.getString("username"));
                    temp.setPassword(resultSet.getString("password"));
                    temp.setUserPermissions(resultSet.getString("user_permissions"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }        public static List<UserInfo> search(UserInfo userInfo)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from user_info";
            sql += MapperUtils.getLikeCondition(userInfo);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<UserInfo> list = new ArrayList<>();
                while (resultSet.next()) {
                    UserInfo temp = new UserInfo();
                    temp.setId(resultSet.getInt("id"));
                    temp.setUsername(resultSet.getString("username"));
                    temp.setPassword(resultSet.getString("password"));
                    temp.setUserPermissions(resultSet.getString("user_permissions"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;        } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    
    
        public static boolean add(UserInfo userInfo) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "insert into user_info(id,username,password,user_permissions) values (NULL,?,?,?)";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                preparedStatement.setString(1, userInfo.getUsername());
                preparedStatement.setString(2, userInfo.getPassword());
                preparedStatement.setString(3, userInfo.getUserPermissions());
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static boolean deleteById(Integer id)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "delete from user_info where id=" + id;
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static int updateById(Integer id, UserInfo userInfo) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "update user_info set ";
            sql += MapperUtils.getUpdateCondition(userInfo);
            sql += " where id = '" + id + "'";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.executeUpdate();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    }
    
    • UserPermissionsMapper
    package mapper;
    
    import org.springframework.jdbc.mapper.MapperUtils;
    import model.UserPermissions;
    import java.util.List;
    import utils.JDBCUtils;
    import java.util.ArrayList;
    import java.sql.*;
    
    public class UserPermissionsMapper {
        public static List<UserPermissions> list() throws Exception{
           return  list(null);
        }
    
        public static List<UserPermissions> list(UserPermissions UserPermissions)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from user_permissions";
            sql += MapperUtils.getEqualCondition(UserPermissions);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (Exception throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<UserPermissions> list = new ArrayList<>();
                while (resultSet.next()) {
                    UserPermissions temp = new UserPermissions();
                    temp.setId(resultSet.getInt("id"));
                    temp.setUserPermissions(resultSet.getString("user_permissions"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }        public static List<UserPermissions> search(UserPermissions userPermissions)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "select * from user_permissions";
            sql += MapperUtils.getLikeCondition(userPermissions);
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            }
            try {
    List<UserPermissions> list = new ArrayList<>();
                while (resultSet.next()) {
                    UserPermissions temp = new UserPermissions();
                    temp.setId(resultSet.getInt("id"));
                    temp.setUserPermissions(resultSet.getString("user_permissions"));
    
                    list.add(temp);
    }
    return list;
            } catch (Exception e) {
                e.printStackTrace();
                throw e;        } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    
    
        public static boolean add(UserPermissions userPermissions) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "insert into user_permissions(id,user_permissions) values (NULL,?)";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                preparedStatement.setString(1, userPermissions.getUserPermissions());
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static boolean deleteById(Integer id)throws Exception {
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "delete from user_permissions where id=" + id;
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.execute();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
        public static int updateById(Integer id, UserPermissions userPermissions) throws Exception{
            Connection connection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            String sql = "update user_permissions set ";
            sql += MapperUtils.getUpdateCondition(userPermissions);
            sql += " where id = '" + id + "'";
            try {
                connection = JDBCUtils.getConnection();
                preparedStatement = connection.prepareStatement(sql);
                return preparedStatement.executeUpdate();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                System.out.printf("===========>>错误:sql=%s<<============%n", sql);
                throw throwables;
            } finally {
                JDBCUtils.close(resultSet, preparedStatement, connection);
            }
        }
    }
    
    • DocumentAttachmentServlet
    package servlet;
    
    import org.springframework.servelt.BaseServlet;
    
    import model.DocumentAttachment;
    import mapper.DocumentAttachmentMapper;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    
    @WebServlet("/documentAttachment")
    public class DocumentAttachmentServlet extends BaseServlet {
        public void listAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
            List<DocumentAttachment> list = DocumentAttachmentMapper.list();
            request.setAttribute("list", list);
            response.sendRedirect(request.getContextPath() + "/DocumentAttachment.jsp");    }    public void deleteById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentAttachmentMapper.deleteById(Integer.parseInt(id));
            listAll(request, response);
        }
        public void getById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentAttachment temp = new DocumentAttachment();
            temp.setId(Integer.parseInt(id));
            List<DocumentAttachment> list = DocumentAttachmentMapper.list(temp);
            if (!list.isEmpty()) {
                request.getSession().setAttribute("documentAttachment", list.get(0));
            }
            response.sendRedirect(request.getContextPath() + "/DocumentAttachmentAdd.jsp");    }    public void updateById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentAttachment temp = new DocumentAttachment();
            String id = request.getParameter("id");
            temp.setId(Integer.parseInt(id));
            String name = request.getParameter("name");
            temp.setName(name);
            String path = request.getParameter("path");
            temp.setPath(path);
            String size = request.getParameter("size");
            temp.setSize(Integer.parseInt(size));
            String documentId = request.getParameter("documentId");
            temp.setDocumentId(Integer.parseInt(documentId));
           DocumentAttachmentMapper.updateById(Integer.parseInt(id), temp);
            listAll(request, response);
        }    public void addBean(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentAttachment temp = new DocumentAttachment();
            String name = request.getParameter("name");
            temp.setName(name);
            String path = request.getParameter("path");
            temp.setPath(path);
            String size = request.getParameter("size");
            temp.setSize(Integer.parseInt(size));
            String documentId = request.getParameter("documentId");
            temp.setDocumentId(Integer.parseInt(documentId));
           DocumentAttachmentMapper.add(temp);
            listAll(request, response);
        }}
    
    • DocumentCategoryServlet
    package servlet;
    
    import org.springframework.servelt.BaseServlet;
    
    import model.DocumentCategory;
    import mapper.DocumentCategoryMapper;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    
    @WebServlet("/documentCategory")
    public class DocumentCategoryServlet extends BaseServlet {
        public void listAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
            List<DocumentCategory> list = DocumentCategoryMapper.list();
            request.setAttribute("list", list);
            response.sendRedirect(request.getContextPath() + "/DocumentCategory.jsp");    }    public void deleteById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentCategoryMapper.deleteById(Integer.parseInt(id));
            listAll(request, response);
        }
        public void getById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentCategory temp = new DocumentCategory();
            temp.setId(Integer.parseInt(id));
            List<DocumentCategory> list = DocumentCategoryMapper.list(temp);
            if (!list.isEmpty()) {
                request.getSession().setAttribute("documentCategory", list.get(0));
            }
            response.sendRedirect(request.getContextPath() + "/DocumentCategoryAdd.jsp");    }    public void updateById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentCategory temp = new DocumentCategory();
            String id = request.getParameter("id");
            temp.setId(Integer.parseInt(id));
            String name = request.getParameter("name");
            temp.setName(name);
           DocumentCategoryMapper.updateById(Integer.parseInt(id), temp);
            listAll(request, response);
        }    public void addBean(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentCategory temp = new DocumentCategory();
            String name = request.getParameter("name");
            temp.setName(name);
           DocumentCategoryMapper.add(temp);
            listAll(request, response);
        }}
    
    • DocumentInfoServlet
    package servlet;
    
    import org.springframework.servelt.BaseServlet;
    
    import model.DocumentInfo;
    import mapper.DocumentInfoMapper;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    
    @WebServlet("/documentInfo")
    public class DocumentInfoServlet extends BaseServlet {    public void listAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
            List<DocumentInfo> list = DocumentInfoMapper.list();
            request.setAttribute("list", list);
            response.sendRedirect(request.getContextPath() + "/DocumentInfo.jsp");    }    public void deleteById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentInfoMapper.deleteById(Integer.parseInt(id));
            listAll(request, response);
        }
        public void getById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            DocumentInfo temp = new DocumentInfo();
            temp.setId(Integer.parseInt(id));
            List<DocumentInfo> list = DocumentInfoMapper.list(temp);
            if (!list.isEmpty()) {
                request.getSession().setAttribute("documentInfo", list.get(0));
            }
            response.sendRedirect(request.getContextPath() + "/DocumentInfoAdd.jsp");    }    public void updateById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentInfo temp = new DocumentInfo();
            String id = request.getParameter("id");
            temp.setId(Integer.parseInt(id));
            String name = request.getParameter("name");
            temp.setName(name);
            String content = request.getParameter("content");
            temp.setContent(content);
            String documentCategory = request.getParameter("documentCategory");
            temp.setDocumentCategory(documentCategory);
           DocumentInfoMapper.updateById(Integer.parseInt(id), temp);
            listAll(request, response);
        }    public void addBean(HttpServletRequest request, HttpServletResponse response) throws Exception {
            DocumentInfo temp = new DocumentInfo();
            String name = request.getParameter("name");
            temp.setName(name);
            String content = request.getParameter("content");
            temp.setContent(content);
            String documentCategory = request.getParameter("documentCategory");
            temp.setDocumentCategory(documentCategory);
           DocumentInfoMapper.add(temp);
            listAll(request, response);
        }}
    
    • LoginOutSevelet
    package servlet;
    
    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 java.io.IOException;
    
    @WebServlet("/logout")
    public class LoginOutSevelet extends HttpServlet {
        @Override
        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            req.getSession().removeAttribute("user");
            req.getSession().removeAttribute("error");
            resp.sendRedirect(req.getContextPath() + "/front/login.jsp");
        }
    }
    
    • LoginSevelet
    package servlet;
    
    import mapper.UserInfoMapper;
    import model.UserInfo;
    
    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 java.io.IOException;
    import java.util.List;
    
    @WebServlet("/login")
    public class LoginSevelet extends HttpServlet {
        @Override
        protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            String username = req.getParameter("username");
            String password = req.getParameter("password");
            UserInfo login = null;
            try {
                UserInfo reader = new UserInfo();
                reader.setUsername(username);
                reader.setPassword(password);
                List<UserInfo> list = UserInfoMapper.list(reader);
                if (!list.isEmpty()) {
                    login = list.get(0);
                }
            } catch (Exception throwables) {
                throwables.printStackTrace();
            }
            if (login == null) {
                req.getSession().setAttribute("error", "用户或者密码错误");
                resp.sendRedirect(req.getContextPath() + "/front/login.jsp");
            } else {
                req.getSession().setAttribute("user", login);
                if ("管理员".equals(login.getUserPermissions())) {
                    resp.sendRedirect(req.getContextPath() + "/index.jsp");
                } else {
                    resp.sendRedirect(req.getContextPath() + "/front/index.jsp");
                }
            }
        }
    }
    
    • Register
    package servlet;
    
    import mapper.UserInfoMapper;
    import model.UserInfo;
    
    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 java.io.IOException;
    
    @WebServlet("/register")
    public class Register extends HttpServlet {
        @Override
        protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            UserInfo temp = new UserInfo();
            String name = req.getParameter("username");
            temp.setUsername(name);
            String password = req.getParameter("password");
            temp.setPassword(password);
            temp.setUserPermissions("普通用户");
            try {
                UserInfoMapper.add(temp);
            } catch (Exception e) {
                e.printStackTrace();
                req.getSession().setAttribute("error", "用户名密码错误");
            }
            resp.sendRedirect(req.getContextPath() + "/front/login.jsp");
        }
    }
    
    • UserInfoServlet
    package servlet;
    
    import org.springframework.servelt.BaseServlet;
    
    import model.UserInfo;
    import mapper.UserInfoMapper;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    
    @WebServlet("/userInfo")
    public class UserInfoServlet extends BaseServlet {
        public void listAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
            List<UserInfo> list = UserInfoMapper.list();
            request.setAttribute("list", list);
            response.sendRedirect(request.getContextPath() + "/UserInfo.jsp");    }    public void deleteById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            UserInfoMapper.deleteById(Integer.parseInt(id));
            listAll(request, response);
        }
        public void getById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            UserInfo temp = new UserInfo();
            temp.setId(Integer.parseInt(id));
            List<UserInfo> list = UserInfoMapper.list(temp);
            if (!list.isEmpty()) {
                request.getSession().setAttribute("userInfo", list.get(0));
            }
            response.sendRedirect(request.getContextPath() + "/UserInfoAdd.jsp");    }    public void updateById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            UserInfo temp = new UserInfo();
            String id = request.getParameter("id");
            temp.setId(Integer.parseInt(id));
            String username = request.getParameter("username");
            temp.setUsername(username);
            String password = request.getParameter("password");
            temp.setPassword(password);
            String userPermissions = request.getParameter("userPermissions");
            temp.setUserPermissions(userPermissions);
           UserInfoMapper.updateById(Integer.parseInt(id), temp);
            listAll(request, response);
        }
        public void addBean(HttpServletRequest request, HttpServletResponse response) throws Exception {
            UserInfo temp = new UserInfo();
            String username = request.getParameter("username");
            temp.setUsername(username);
            String password = request.getParameter("password");
            temp.setPassword(password);
            String userPermissions = request.getParameter("userPermissions");
            temp.setUserPermissions(userPermissions);
           UserInfoMapper.add(temp);
            listAll(request, response);
        }}
    
    • UserPermissionsServlet
    package servlet;
    
    import org.springframework.servelt.BaseServlet;
    
    import model.UserPermissions;
    import mapper.UserPermissionsMapper;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    
    @WebServlet("/userPermissions")
    public class UserPermissionsServlet extends BaseServlet {    public void listAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
            List<UserPermissions> list = UserPermissionsMapper.list();
            request.setAttribute("list", list);
            response.sendRedirect(request.getContextPath() + "/UserPermissions.jsp");    }    public void deleteById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            UserPermissionsMapper.deleteById(Integer.parseInt(id));
            listAll(request, response);
        }
        public void getById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            String id = request.getParameter("id");
            UserPermissions temp = new UserPermissions();
            temp.setId(Integer.parseInt(id));
            List<UserPermissions> list = UserPermissionsMapper.list(temp);
            if (!list.isEmpty()) {
                request.getSession().setAttribute("userPermissions", list.get(0));
            }
            response.sendRedirect(request.getContextPath() + "/UserPermissionsAdd.jsp");    }    public void updateById(HttpServletRequest request, HttpServletResponse response) throws Exception {
            UserPermissions temp = new UserPermissions();
            String id = request.getParameter("id");
            temp.setId(Integer.parseInt(id));
            String userPermissions = request.getParameter("userPermissions");
            temp.setUserPermissions(userPermissions);
           UserPermissionsMapper.updateById(Integer.parseInt(id), temp);
            listAll(request, response);
        }    public void addBean(HttpServletRequest request, HttpServletResponse response) throws Exception {
            UserPermissions temp = new UserPermissions();
            String userPermissions = request.getParameter("userPermissions");
            temp.setUserPermissions(userPermissions);
           UserPermissionsMapper.add(temp);
            listAll(request, response);
        }}
    
    • DocumentAttachment
    package model;
    
    import java.util.Date;
    
    public class DocumentAttachment {
        private Integer id;
    public Integer getId() {
            return id;
        }
        public void setId(Integer id) {
            this.id = id;
        }//Integer的默认值为null
        private String name;
    public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        private String path;
    public String getPath() {
            return path;
        }
        public void setPath(String path) {
            this.path = path;
        }
        private Integer size;
    public Integer getSize() {
            return size;
        }
        public void setSize(Integer size) {
            this.size = size;
        }
        private Integer documentId;
    public Integer getDocumentId() {
            return documentId;
        }
        public void setDocumentId(Integer documentId) {
            this.documentId = documentId;
        }
    }
    
    • DocumentCategory
    package model;
    
    import java.util.Date;
    
    public class DocumentCategory {
        private Integer id;
    public Integer getId() {
            return id;
        }
        public void setId(Integer id) {
            this.id = id;
        }
        private String name;
    public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
    }
    
    • DocumentInfo
    package model;
    
    import java.util.Date;
    
    public class DocumentInfo {
        private Integer id;
    public Integer getId() {
            return id;
        }
        public void setId(Integer id) {
            this.id = id;
        }
        private String name;
    public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        private String content;
    public String getContent() {
            return content;
        }
        public void setContent(String content) {
            this.content = content;
        }
        private String documentCategory;
    public String getDocumentCategory() {
            return documentCategory;
        }
        public void setDocumentCategory(String documentCategory) {
            this.documentCategory = documentCategory;
        }
    }
    
    • UserInfo
    package model;
    
    import java.util.Date;
    
    public class UserInfo {
        private Integer id;
    public Integer getId() {
            return id;
        }
        public void setId(Integer id) {
            this.id = id;
        }
        private String username;
    public String getUsername() {
            return username;
        }
        public void setUsername(String username) {
            this.username = username;
        }
        private String password;
    public String getPassword() {
            return password;
        }
        public void setPassword(String password) {
            this.password = password;
        }
        private String userPermissions;
    public String getUserPermissions() {
            return userPermissions;
        }
        public void setUserPermissions(String userPermissions) {
            this.userPermissions = userPermissions;
        }
    }
    
    • UserPermissions
    package model;
    
    import java.util.Date;
    
    public class UserPermissions {
        private Integer id;
    public Integer getId() {
            return id;
        }
        public void setId(Integer id) {
            this.id = id;
        }
        private String userPermissions;
    public String getUserPermissions() {
            return userPermissions;
        }
        public void setUserPermissions(String userPermissions) {
            this.userPermissions = userPermissions;
        }
    }
    

    源代码工程下载

    点击此处下载

    展开全文
  • 文章目录前言1 课题描述2 相关技术3 系统需求分析3.1 功能需求分析3.1.1 学生端:3.1.2 超级管理员端:3.1.3 试题管理员端(老师):4 系统设计框架4.1 系统基本功能4.2 登录功能4.3 系统答题4.4 答题得分4.5 错题...
  • 基于web的库存管理系统

    千次阅读 2021-02-21 21:38:26
    系统通过Microsoft Visual Web Developer 2005中的C#语言编写,连接Microsoft SQL Server 2000运行。在该系统中可以实现对仓库的基本维护,例如,对仓库和货物信息进行添加、删除、修改和查询等功能;同时也可满足...
  • Java Web(九) 用户管理系统

    千次阅读 2021-03-08 16:12:12
    --WZY 一、需求分析 讲过一点,这个非常的简单,就增删改查的运用, 注册、登录、查询所有用户、查询详情、修改、删除 两个权限, 一个权限是管理员权限,登录进系统后,就能看到所有用户的信息并且能够对所有...
  • 基于java web实现的图书管理系统

    千次阅读 2021-02-28 11:16:53
    基于jsp+servlet的图书管理系统演示地址为 http://www.ym4j.com/WebLibrary/ 用户名:mr ,密码:123图书馆管理系统主要的目的是实现图书馆的信息化管理。图书馆的主要业务就是新书的借阅和归还,因此系统最核心的功能...
  • 今天学长向大家分享一个 java web 项目: 基于新闻发布及管理系统的设计与实现 适合做毕业设计使用。 一、项目设计 1. 模块设计 系统设计 据新闻发布系统的需求分析,确定此系统分为前台新闻显示和后台管理两类。...
  • 学生成绩查询web系统—功能概述

    千次阅读 2021-01-06 12:04:38
    学生成绩查询web系统—功能概述 文章目录学生成绩查询web系统—功能概述任务摘要一、前景介绍1、背景2、规划二、技术分析1、前端技术2、后端技术3、数据库4、登录验证三、功能模块1、系统划分及功能2、功能例图四...
  • 2021 年在 Web 领域有哪些关键进展?

    千次阅读 2021-12-17 01:31:48
    DID 的基础是将身份控制权交还给互联网用户,并授权他们使用自己信任的系统生成唯一的标识符。通过使用加密证明(如数字签名)对这些标识符进行认证,个人和组织都可以利用区块链的分布式账本技术(DLT)从无缝、安全和...
  • 基于Web的学生成绩管理系统

    千次阅读 2021-02-09 17:02:25
    源码及论文下载: ... 摘 要 本次课程设计课题为学生成绩管理系统,该学生成绩管理系统主要包括前台用户界面的开发和后台数据库的开发,重点在于后台...本系统主要运用MySQL为后台数据库,web作为前台技术,以eclipse为开
  • 简单的学生成绩查询web系统

    千次阅读 2021-01-11 16:01:59
    实验内容:基于 JSP+Mysql 做一个简单的学生成绩查询web系统。 Java Web Java Web,是用Java技术来解决相关web互联网领域的技术总和。web包括:web服务器和web客户端两部分。Java在客户端的应用java applet,不过...
  • Web点餐系统(前端开发)

    千次阅读 2021-06-09 16:23:28
    【实例简介】该Web点餐系统是为了给食堂提供下一天的菜品做参考,使用HTML5 + CSS3 + JS(jQuery)进行前端开发,数据库采用本地数据库WebSQL,不使用后端开发。【实例截图】【核心代码】acdfbfc4-e48e-4626-8ec1-38aa...
  • 基于web的电影订票系统 是我同学做的毕设。 功能齐全、系统友好。 需要请联系 使用语言:java 软件:Eclipse(idea亦可)、MySQL数据库、win10系统 1.需求分析 (1)系统用例分析 系统设计了用户角色和管理员角色...
  • 任务1 开发第一个简单的JSP应用1.1 任务说明1.2 任务准备一一知识引领1.2.1 什么是HTML1.2.2 什么是JSP1.3 任务计划及实施1.3.1 安装与配置JDK 1.61.3.2 安装Web服务器丁omcat 6.01.3.3 开发一个简单的静态页面count...
  • web课程设计:网上商城系统

    千次阅读 多人点赞 2021-03-09 13:10:22
    web课程设计:网上商城系统 项目详情: 课程设计:网上商城系统 2019.6-2019.7 1.1 选题目的及意义 网上购物系统构建初始目标主要是面对广大消费者,网上商店成本较低,而且运营简单方便,不需要太多人力来管理,...
  • web服务器的作用

    千次阅读 2021-07-30 02:43:35
    web服务器的作用[编辑]概述Web服务器一般指网站服务器,是指驻留于因特网上某种类型计算机的程序,它的主要作用是向浏览器等Web客户端提供文档,放置网站文件让网络用户浏览以及提供可以下载的数据文件。一、web...
  • 基于Java Web的图书销售管理系统

    千次阅读 2021-02-12 17:50:15
    项目描述本系统是基于jsp的网上图书销售,比较符合初学者的简单而又不单一的界面,也繁琐而又不过于抽象的后台数据处理。包含分类的登录用户(用户与管理员权限与界面不一),功能,登录与未登录相应的权限设置...
  • 基于Web的图书管理系统运行教程

    千次阅读 2021-11-27 19:46:39
    文章目录1、前期必备1.1、下载源码1.2、下载开发工具1.3、下载Tomcat1.4、下载JDK并...本教程源码我已经放到网盘了,在公众号【IT学长】回复 “基于web的图书管理系统”自行下载。 1.2、下载开发工具 作者用目前非常流
  • 基于java web的网上零食销售系统的设计与实现 一、项目设计 1. 模块设计 功能分析 经过对时下大型电商网站的调查,对该系统的功能进行的大体的划分,网上零食销售系统将划分为两大管理模块。前台模块涵盖物品类别的...
  • 基于Web酒店管理系统的设计与实现

    千次阅读 2020-12-24 04:56:37
    一、基本信息标题:基于Web酒店管理系统的设计与实现时间:2018年来源: 河北民族师范学院数学与计算机科学学院关键词:Web;酒店管理系统;设计实现;MySQL二、研究内容1.摘要构建基于Web的酒店管理系统,实现利用...
  • web系统架构优化

    万次阅读 2021-03-31 07:55:33
    消息队列可以对系统进行解耦,并可提高系统的处理能力,减少数据库的压力。如果是微软路线可以考虑用MSMQ。 业务处理层不要使用单例模式 因为单例模式的话,会阻碍多线程和多核系统的处理,降低系统的吞吐量和...
  • 点餐系统(Java Web前后台) 实例为Java语言实现点餐系统,主要以前端:css、javascript、jquery(js框架), 后端:jsp、Servlet(接入层)、jdbc ,数据库:mysql,服务器:tomcat8.0,采用java语言开发的管理系统,...
  • 技术:Java、JSP等 摘要:管理信息系统在现代社会已经深入到各行各业,随着计算机技术的迅速发展和普及,信息管理系统事实上已经成为计算机管理信息系统,大学宿舍管理...经分析,此系统设计上采用三层结构、Web Serv
  • Java web课程设计-购物系统

    千次阅读 2020-12-29 10:32:13
    题目:网上购物系统 网上购物商店的分析与实现 一.实验目的 Java web课程设计是为了是计算机学院的学子深入学习java web应用开发设置的一门实验性的动手性的实践课程。是计算机科学与技术、 网络工程、信息安全、...
  • 1.1系统研究背景和意义 近年来,随着我国经济的快速发展,人们生活水平的不断提高,物质需求和生活方式也发生着深刻的变化,以前属于奢侈品的汽车己经逐步走入了市民的日常生活。伴随汽车消费大众化和各种机动车辆大...
  • JavaWeb系统系列实现 Java+JSP实现学生图书管理系统 Java+JSP实现学生信息管理系统 Java+JSP实现用户信息管理系统 Java+Servlet+JSP实现航空订票系统 Java+Servlet+JSP实现新闻发布系统 Java+Servlet+JSP学生...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,964,427
精华内容 785,770
关键字:

web系统有哪些