资源简介
基于SSM的简单图书管理系统
代码片段和文件信息
package com.library.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.library.pojo.Book;
import com.library.pojo.BookType;
import com.library.pojo.Record;
import com.library.service.BookService;
import com.library.service.ReaderService;
import com.library.service.RecordService;
@Controller
public class BookController {
@Autowired
private BookService bookService;
@Autowired
private RecordService recordService;
@Autowired
private ReaderService readerService;
@RequestMapping(“/book/list“)
public String bookList(Model modelHttpServletRequest request) throws Exception{
request.setCharacterEncoding(“UTF-8“);
String name = request.getParameter(“bookName“);
String type = request.getParameter(“bookType“);
String press = request.getParameter(“bookPress“);
List bookList = bookService.queryBook(name type press);
List bookTypeList = bookService.queryAllBookType();
List bookNumberList = bookService.queryBookNumber();
List readerNumberList = readerService.queryReaderNumber();
model.addAttribute(“books“ bookList);
request.getSession().setAttribute(“bookTypes“ bookTypeList);
request.getSession().setAttribute(“bookNumbers“ bookNumberList);
request.getSession().setAttribute(“readerNumbers“ readerNumberList);
model.addAttribute(“bookName“ name);
model.addAttribute(“bookType“ type);
return “admin_books“;
}
@RequestMapping(“/book/edit.action“)
public @ResponseBody Book bookEdit(String number){
Book book = bookService.queryBookByNumber(number);
return book;
}
@RequestMapping(“/book/update.action“)
public @ResponseBody String bookUpdate(Book book){
bookService.updateBookById(book);
return “OK“;
}
/*用book实体接收不了前端传过来的变量,只能一个一个收*/
@RequestMapping(“/book/add.action“)
public @ResponseBody String bookAdd(HttpServletRequest request) throws Exception{
Date publicationdate = null;
Integer pagecount = null;
BigDecimal price = null;
String name = request.getParameter(“name“);
String type = request.getParameter(“type“);
String author = request.getParameter(“anthor“);
String number = request.getParameter(“number“);
String press = request.getParameter(“press“);
String publicationdateStr = request.getParameter(“publicationdate“);
String priceStr = request.getParameter(“price“);
String pagecountStr = request.getParameter(“pagecount“);
String remark = request.getParameter(“remark“);
SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd“);
String createtimeStr = sdf.format(new Date());
Date createtime = sdf.parse(createtimeStr);
if(publicationdateSt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\
文件 817 2019-07-08 15:32 SSM-LibrarySystem-master\.classpath
文件 1004 2019-07-08 15:32 SSM-LibrarySystem-master\.project
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\
文件 555 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\.jsdtscope
文件 55 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.core.resources.prefs
文件 357 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.jdt.core.prefs
文件 465 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.wst.common.component
文件 335 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2019-07-08 15:32 SSM-LibrarySystem-master\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1923 2019-07-08 15:32 SSM-LibrarySystem-master\README.md
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\me
文件 36 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\me
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\
文件 26450 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\admin_books.jsp
文件 12701 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\admin_booktype.jsp
文件 4913 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\admin_main.jsp
文件 22180 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\admin_readers.jsp
文件 14478 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\admin_readertype.jsp
文件 12637 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\index.jsp
文件 4810 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\jsp\record.jsp
目录 0 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\
文件 4467 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\aopalliance-1.0.jar
文件 43581 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\asm-3.3.1.jar
文件 1862339 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\aspectjweaver-1.8.4.jar
文件 287192 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\cglib-2.2.2.jar
文件 232771 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\commons-codec-1.6.jar
文件 85646 2019-07-08 15:32 SSM-LibrarySystem-master\WebContent\WEB-INF\lib\commons-collections-1.0.jar
............此处省略133个文件信息
相关资源
- 基于SSH的项目源码(尚硅谷整合代码
- 爱上processing
- 基于SpringBoot+vue的前后端分离酒店预订
- ssm整合实现商品查询和修改
- SSM框架整合项目
- SSM框架下实现注册登录
- 生产过程管理系统
- 名片管理系统 Struts2+Hibernate
- 简单的ssh框架项目
- 网上购物在线商城
- Spring5源码深度解析-某Tom老师
- SSM框架项目162477
- 健身网站完整的源码
- 实验预约系统
- 物流配送管理系统源码
- apache-tomcat-8.5.46-windows-x64.zip
- 一个很详细且简单的SSM开发小案例
- SSM+Neo4j+Echarts完整版
- 基于SSM框架开发的因酷开源网络课堂
- vip会员管理系统、 基于spirng mvc、 s
- 基于 spring,spring mvc,mybatis 权限管理
- Spring mvc + Spring + Spring jdbc 整合
- 基于 Struts2,Hibernate,Spring 框架开发
- 基于spring mvc、spring、hibernate、bootst
- ssm框架整合spring、spring mvc、mybatis开发
- 通用开发平台spring mvc + spring + bootst
- 教师评价系统1.zip
- 完整的电力系统项目
- 算法(第四版)_算法红宝书_图灵图书
- ssm 框架做的电子商城购物网站完整代
评论
共有 条评论