Spring中的aware接口详情
260
2022-09-15
Java 前台加后台精品图书管理系统的实现
一、项目简述
功能包括: 登录注册,办理借阅。借阅记录,预约借阅,借出未还, 借阅逾期,学生管理,图书管理,书库分类查询搜索。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: jsP +Spring + SpringMVC + MyBatis + html+ css + javascript + jquery + Ajax + layui+ maven等等。
修改图书类型信息代码:
/**
* Servlet implementation class updateBookTypeServlet
*/
@WebServlet("/updateBookTypeServlet")
public class updateBookTypeServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public updateBookTypeServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// doGet(request, response);
//修改图书类型信息
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
String name = request.getParameter("name");
int tid = Integer.parseInt(request.getParameter("tid"));
TypeDao typedao = new TypeDao();
typedao.updateTypeBook(tid,name);
response.sendRedirect("/books/admin_booktype.jsp");
}
}
登录图书管理系统主页面代码:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import = "com.rain.bean.AdminBean,com.rain.bean.HistoryBean,com.rain.dao.AdminDao" %>
<%
AdminBean admin = new AdminBean();
String aid = (String)session.getAttribute("aid");
AdminDao admindao = new AdminDao();
admin = admindao.get_AidInfo2(aid);
%>
<http://;ul>
<ul>
×
修改密码
修改
×
个人资料
修改
图书操作代码:
/**
* @description: 图书操作
*/
@Controller
@RequestMapping("/admin/ch")
public class LibraryController {
//注入
@Autowired
private LibraryService libraryService;
/**
* 修改图书信息
*
* @param uploadFile 上传图片
* @param library 图书信息
* @return
*/
@RequestMapping(value = "/updateBook", method = RequestMethod.POST)
public String updateBook(MultipartFile uploadFile, TbLibrary library, HttpServletRequest request) {
try {
libraryService.updateOrSaveLibrary(uploadFile, library,request);
} catch (IOException e) {
e.printStackTrace();
}
return "redirect:/admin/ch/loan_bookList.action";
}
/**
* 添加图书
*
* @param uploadFile 上传图片
* @param library 图书信息
* @return
*/
@RequestMapping(value = "/addBook", method = RequestMethod.POST)
public String addBook(MultipartFile uploadFile, TbLibrary library, HttpSession session,HttpServletRequest request) {
ActiveAdmin activeAdmin = (ActiveAdmin) session.getAttribute("activeAdmin");
library.setManagerId(activeAdmin.getUserid());
try {
libraryService.updateOrSaveLibrary(uploadFile, library,request);
} catch (IOException e) {
e.printStackTrace();
}
return "redirect:/admin/ch/loan_bookList.action";
}
/**
* 根据 图书id 删除 图书
*
* @param id 图书id
* @return
*/
@RequestMapping("/delBookById")
public String delBook(int id) {
libraryService.delBookById(id);
return "redirect:/admin/ch/loan_bookList.action";
}
}
以上就是Java 前台加后台精品图书管理系统实现的详细内容,更多关于Java 图书管理系统的资料请关注我们其它相关文章!
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~