基于Struts2的图书管理系统源代码

上传者: achenxuxu | 上传时间: 2019-12-21 19:22:56 | 文件大小: 13.98MB | 文件类型: zip
一.功能简介 1. 实现一个图书管理系统。图书信息存放到一个数据库中。图书包含信息:图书号、图书名、作者、价格、备注字段。 2. 系统实现如下的基本管理功能: (1)用户分为两类:系统管理员,一般用户。 (2)提供用户注册和用户登录验证功能;其中登录用户的信息有:登录用户名,登录密码等。 (3)管理员可以实现对注册用户的管理(删除),并实现对图书的创建、查询、修改和删除等有关的操作。 (4)一般用户,只能查询图书,并进行借书、还书操作,每个用户最多借阅8本,即当目前借书已经是8本,则不能再借书了,只有还书后,才可以再借阅。 二.涉及技术 Struts2框架、MySQL数据库、C3P0数据池、Jsp、HTML、CSS、JavaScript等技术。 三.设计思路 1. 基于Struts2框架进行编程设计,连接MySQL数据库实现数据的增删查改,应用Jsp、HTML、CSS、JavaScript对访问页面进行编写和美化。 2. 分别创建book表和user表,用以存放图书信息和用户数据。其中user表中,设有flag以区分管理员和普通用户。 3. 分别创建Book类和User类,与数据表相对应。每本书和每个用户都有唯一的id与之对应。 4. 创建C3P0属性文件和数据库连接工具类。 5. 设计数据库操作类:UserDao类和BookDao类。UserDao用于实现所有对user表的操作,BookDao用于实现所有对book表的操作。 6. 创建分别对应UserDao类和BookDao类的Action:UserAction和BookAction。采用基于注解的方式进行Action配置。 7. 用户账号分为管理员账号和普通用户账号,注册时加以区分,登录时即可自动判断进入对应的操作主页面。 8. 管理员可实现对用户的查询显示,模糊查询,删除,批量删除,全选和取消全选等功能;可实现对图书的查询显示,模糊查询,添加,删除,批量删除,全选和取消全选等功能。 9. 普通用户可实现借书和还书功能,借书功能通过对book表的查询,将未借出的图书按照id顺序排列显示,点击表格后方的“借阅”按钮,进行确认借阅,将book表中本书的borrowperson列的值改为本用户账号。对于借阅成功的图书可以在“当前借阅”中进行查看。还书功能通过在“当前借阅”中点击“还书”按钮,进行确认还书,将book表中本书的borrowperson列的值改为“空”,本书信息将可以在“借书”界面查看。 四.存在的问题 1. 原本希望能为每一个用户创建一个对应的以其账号命名的数据表,用以存放用户所借图书信息,但创建表的SQL语句无法在java代码中执行,所以只好在book表中添加一列borrowperson,用来存放借阅本书的用户账号,这样查询用户当前借阅记录时,以“where borrowperson=‘account’”为条件对book表进行查询即可。但是每个用户要当前查询借阅记录时都需要对整个book表进行遍历,效率太低。 2. 模糊查询时,因同时需要进行where筛选,SQL语句无法执行,只好分开查询,先进行模糊查询,查询结果存放到list表中,再通过遍历list表进行判断是否符合where的条件,若符合,则存入另一个list表中。这种方法虽然实现了查询,但效率太低,代码过于繁重。 五.改进预想 这些本不应该是预想,原本希望在本次作业中实现的,但时间不够充分,只能作为下一步的改建预想。 1. 希望实现登录时验证码验证登录; 2. 希望实现查询时,查询结果分页浏览; 3. 进一步优化Action之间的传值方法; 4. 页面进一步优化、美化; 5. 实现用户借书还书时间记录,和借阅时长限制。

文件下载

资源详情

[{"title":"( 80 个子文件 13.98MB ) 基于Struts2的图书管理系统源代码","children":[{"title":"BookManage_1","children":[{"title":"WebContent","children":[{"title":"image","children":[{"title":"b.jpg <span style='color:#111;'> 41.31KB </span>","children":null,"spread":false},{"title":"vv.jpg <span style='color:#111;'> 32.83KB </span>","children":null,"spread":false},{"title":"blue.jpg <span style='color:#111;'> 393.22KB </span>","children":null,"spread":false},{"title":"f.jpg <span style='color:#111;'> 135.04KB </span>","children":null,"spread":false},{"title":"d.jpg <span style='color:#111;'> 50.86KB </span>","children":null,"spread":false}],"spread":true},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 39B </span>","children":null,"spread":false}],"spread":true},{"title":"WEB-INF","children":[{"title":"web.xml <span style='color:#111;'> 947B </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"hibernate-core-4.3.10.Final.jar <span style='color:#111;'> 5.04MB </span>","children":null,"spread":false},{"title":"hibernate-jpa-2.1-api-1.0.0.Final.jar <span style='color:#111;'> 110.71KB </span>","children":null,"spread":false},{"title":"dom4j-1.6.1.jar <span style='color:#111;'> 306.54KB </span>","children":null,"spread":false},{"title":"javassist-3.11.0.GA.jar <span style='color:#111;'> 599.81KB </span>","children":null,"spread":false},{"title":"antlr-2.7.7.jar <span style='color:#111;'> 434.85KB </span>","children":null,"spread":false},{"title":"asm-tree-3.3.jar <span style='color:#111;'> 21.00KB </span>","children":null,"spread":false},{"title":"mysql-connector-java-5.1.13-bin.jar <span style='color:#111;'> 749.50KB </span>","children":null,"spread":false},{"title":"mchange-commons-java-0.2.3.4.jar <span style='color:#111;'> 567.67KB </span>","children":null,"spread":false},{"title":"asm-3.3.jar <span style='color:#111;'> 42.56KB </span>","children":null,"spread":false},{"title":"xwork-core-2.3.24.jar <span style='color:#111;'> 660.91KB </span>","children":null,"spread":false},{"title":"log4j-core-2.2.jar <span style='color:#111;'> 807.36KB </span>","children":null,"spread":false},{"title":"jboss-logging-annotations-1.2.0.Beta1.jar <span style='color:#111;'> 11.29KB </span>","children":null,"spread":false},{"title":"jandex-1.1.0.Final.jar <span style='color:#111;'> 74.76KB </span>","children":null,"spread":false},{"title":"jboss-logging-3.1.3.GA.jar <span style='color:#111;'> 55.84KB </span>","children":null,"spread":false},{"title":"struts2-convention-plugin-2.3.24.jar <span style='color:#111;'> 65.94KB </span>","children":null,"spread":false},{"title":"javassist-3.18.1-GA.jar <span style='color:#111;'> 697.46KB </span>","children":null,"spread":false},{"title":"ognl-3.0.6.jar <span style='color:#111;'> 222.65KB </span>","children":null,"spread":false},{"title":"freemarker-2.3.22.jar <span style='color:#111;'> 1.24MB </span>","children":null,"spread":false},{"title":"c3p0-0.9.2.1.jar <span style='color:#111;'> 413.94KB </span>","children":null,"spread":false},{"title":"hibernate-commons-annotations-4.0.5.Final.jar <span style='color:#111;'> 73.56KB </span>","children":null,"spread":false},{"title":"log4j-api-2.2.jar <span style='color:#111;'> 130.39KB </span>","children":null,"spread":false},{"title":"jstl-1.2.jar <span style='color:#111;'> 404.53KB </span>","children":null,"spread":false},{"title":"asm-commons-3.3.jar <span style='color:#111;'> 37.38KB </span>","children":null,"spread":false},{"title":"jboss-transaction-api_1.2_spec-1.0.0.Final.jar <span style='color:#111;'> 27.07KB </span>","children":null,"spread":false},{"title":"struts2-core-2.3.24.jar <span style='color:#111;'> 812.47KB </span>","children":null,"spread":false},{"title":"commons-io-2.2.jar <span style='color:#111;'> 169.52KB </span>","children":null,"spread":false},{"title":"hibernate-c3p0-4.3.10.Final.jar <span style='color:#111;'> 39.14KB </span>","children":null,"spread":false},{"title":"jxl.jar <span style='color:#111;'> 708.73KB </span>","children":null,"spread":false},{"title":"commons-lang3-3.2.jar <span style='color:#111;'> 375.75KB </span>","children":null,"spread":false},{"title":"commons-fileupload-1.3.1.jar <span style='color:#111;'> 67.38KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"book","children":[{"title":"result.jsp <span style='color:#111;'> 604B </span>","children":null,"spread":false},{"title":"insert.jsp <span style='color:#111;'> 2.63KB </span>","children":null,"spread":false},{"title":"now_borrow.jsp <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"borrow.jsp <span style='color:#111;'> 2.18KB </span>","children":null,"spread":false},{"title":"manage_book.jsp <span style='color:#111;'> 3.56KB </span>","children":null,"spread":false},{"title":"borrow_result.jsp <span style='color:#111;'> 1.64KB </span>","children":null,"spread":false},{"title":"return_result.jsp <span style='color:#111;'> 1.64KB </span>","children":null,"spread":false}],"spread":true},{"title":"user","children":[{"title":"login_result.jsp <span style='color:#111;'> 351B </span>","children":null,"spread":false},{"title":"register_result.jsp <span style='color:#111;'> 747B </span>","children":null,"spread":false},{"title":"main_manager.jsp <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"result.jsp <span style='color:#111;'> 606B </span>","children":null,"spread":false},{"title":"login.jsp <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"register.jsp <span style='color:#111;'> 4.31KB </span>","children":null,"spread":false},{"title":"main_user.jsp <span style='color:#111;'> 1.38KB </span>","children":null,"spread":false},{"title":"manage_user.jsp <span style='color:#111;'> 3.35KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.wst.jsdt.ui.superType.name <span style='color:#111;'> 6B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.project.facet.core.xml <span style='color:#111;'> 345B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.component <span style='color:#111;'> 488B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.jsdt.ui.superType.container <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":".jsdtscope <span style='color:#111;'> 567B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 364B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"conf","children":[{"title":"struts-book.xml <span style='color:#111;'> 356B </span>","children":null,"spread":false}],"spread":true},{"title":"com","children":[{"title":"cxx","children":[{"title":"dao","children":[{"title":"UserDao.java <span style='color:#111;'> 5.28KB </span>","children":null,"spread":false},{"title":"BookDao.java <span style='color:#111;'> 4.77KB </span>","children":null,"spread":false}],"spread":true},{"title":"action","children":[{"title":"UserAction.java <span style='color:#111;'> 5.93KB </span>","children":null,"spread":false},{"title":"BookAction.java <span style='color:#111;'> 5.91KB </span>","children":null,"spread":false}],"spread":true},{"title":"entity","children":[{"title":"User.java <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"Book.java <span style='color:#111;'> 2.28KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"JdbcPoolUtils.java <span style='color:#111;'> 1.67KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"struts.xml <span style='color:#111;'> 333B </span>","children":null,"spread":false},{"title":"c3p0.properties <span style='color:#111;'> 171B </span>","children":null,"spread":false}],"spread":true},{"title":".project <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 3.17KB </span>","children":null,"spread":false},{"title":"build","children":[{"title":"classes","children":[{"title":"conf","children":[{"title":"struts-book.xml <span style='color:#111;'> 356B </span>","children":null,"spread":false}],"spread":true},{"title":"com","children":[{"title":"cxx","children":[{"title":"dao","children":[{"title":"UserDao.class <span style='color:#111;'> 5.27KB </span>","children":null,"spread":false},{"title":"BookDao.class <span style='color:#111;'> 6.06KB </span>","children":null,"spread":false}],"spread":true},{"title":"action","children":[{"title":"BookAction.class <span style='color:#111;'> 6.38KB </span>","children":null,"spread":false},{"title":"UserAction.class <span style='color:#111;'> 5.71KB </span>","children":null,"spread":false}],"spread":true},{"title":"entity","children":[{"title":"User.class <span style='color:#111;'> 1.99KB </span>","children":null,"spread":false},{"title":"Book.class <span style='color:#111;'> 3.15KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"JdbcPoolUtils.class <span style='color:#111;'> 2.43KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"struts.xml <span style='color:#111;'> 333B </span>","children":null,"spread":false},{"title":"c3p0.properties <span style='color:#111;'> 171B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • 赵广陆 :
    还不错,挺好
    2020-03-24

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明