@RequestMapping("/querybook.html")
public ModelAndView queryBookDo1(HttpServletRequest request,@RequestParam("searchWord") String bookname , Book book) {
if(bookname!=null){
try{
bookname = new String(bookname.getBytes("ISO8859-1"),"UTF-8");
}catch (UnsupportedEncodingException e){
e.printStackTrace();
}
}
book.setName(bookname);
System.out.println("==========打印传参"+book.getName());
if (bookService.matchBook1(book)) {
ArrayList<Book> books = bookService.queryBook1(book);
ModelAndView modelAndView = new ModelAndView("admin_books");
modelAndView.addObject("books", books);
return modelAndView;
} else {
return new ModelAndView("admin_books", "error", "没有匹配的图书");
}
}