资源简介

ssh框架的完整实现,内置完整权限管理模块 通过Ajax异步刷新实现显示不同登录角色所具有的权限,实现文件上传,访问拦截,validation校验等,界面美观大方

资源截图

代码片段和文件信息

package cn.edu.njxzc.soft03.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.edu.njxzc.soft03.model.BookInfo;
import cn.edu.njxzc.soft03.model.UserInfo;
import cn.edu.njxzc.soft03.service.BookService;
import cn.edu.njxzc.soft03.service.BrrowService;
import cn.edu.njxzc.soft03.util.MutiPartUtil;

@Controller
@RequestMapping(“/book“)
public class BookController {

@Resource
private BookService bookService;

@Resource
private BrrowService brrowService;

@RequestMapping(“query“)
public ModelAndView query() {
List bookList = bookService.getAllBooks();

return new ModelAndView(“/view/book/booklist.jsp“ “bookList“ bookList);
}

@RequestMapping(“bookBrowse“)
public ModelAndView toBookBrowse(ModelMap map){
List> booksPageByFour=bookService.getBooksPageByFour();
map.put(“booksPageByFour“ booksPageByFour);
map.put(“size“bookService.getAllBooks().size());
return new ModelAndView(“/view/book/bookbrowse.jsp““booksPageByFour“booksPageByFour);
}

@RequestMapping(“add“)
public ModelAndView add(BookInfo info HttpServletRequest request) {
if (info.getId() > 0) {

if (““.equals(info.getImg_path())) {
info.setImg_path(MutiPartUtil.saveMutiPart(request));
}

bookService.updateBook(info);
} else {
bookService.addBook(info request);
}
return new ModelAndView(“redirect:/book/query.do“);
}

@RequestMapping(“del“)
public ModelAndView add(int id) {
bookService.delBook(id);
return new ModelAndView(“redirect:/book/query.do“);
}

@RequestMapping(“toModify“)
public ModelAndView toModify(int id) {
BookInfo info = bookService.getBook(id);
return new ModelAndView(“/view/book/bookadd.jsp“ “bookInfo“ info);
}
@RequestMapping(“brrow“)
public ModelAndView Brrow(int book_idHttpServletRequest request){
UserInfo userinfo=(UserInfo)request.getSession().getAttribute(“login_info“);
BookInfo info=bookService.getBook(book_id);
info.setNum(info.getNum()-1);
bookService.updateBook(info);
brrowService.add(userinfo.getId() book_id);
return new ModelAndView(“redirect:/book/bookBrowse.do“);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-28 22:39  book\
     文件        9569  2016-06-28 17:57  book.sql
     文件        1803  2016-06-20 21:47  book\.classpath
     目录           0  2016-06-16 09:51  book\.myeclipse\
     文件         554  2016-06-16 09:55  book\.myhibernatedata
     文件         285  2016-06-16 09:51  book\.mymetadata
     文件        2024  2016-06-16 10:31  book\.project
     目录           0  2016-06-28 22:39  book\.settings\
     文件         500  2016-06-16 09:51  book\.settings\.jsdtscope
     文件         348  2016-06-20 21:47  book\.settings\com.genuitec.eclipse.migration.prefs
     文件         116  2016-06-20 21:47  book\.settings\com.genuitec.runtime.libraries.xml
     文件         123  2016-06-22 10:30  book\.settings\org.eclipse.core.resources.prefs
     文件         395  2016-06-16 09:51  book\.settings\org.eclipse.jdt.core.prefs
     文件         538  2016-06-20 21:47  book\.settings\org.eclipse.wst.common.component
     文件         482  2016-06-20 21:47  book\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         460  2016-06-20 21:47  book\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-06-16 09:51  book\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-06-16 09:51  book\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件         462  2016-06-16 09:55  book\.springBeans
     目录           0  2016-06-28 22:39  book\src\
     文件        2838  2016-06-21 11:30  book\src\applicationContext.xml
     目录           0  2016-06-28 22:39  book\src\cn\
     目录           0  2016-06-28 22:39  book\src\cn\edu\
     目录           0  2016-06-28 22:39  book\src\cn\edu\njxzc\
     目录           0  2016-06-28 22:39  book\src\cn\edu\njxzc\soft03\
     目录           0  2016-06-28 22:39  book\src\cn\edu\njxzc\soft03\controller\
     文件        2459  2016-06-23 12:35  book\src\cn\edu\njxzc\soft03\controller\BookController.java
     文件        1745  2016-06-23 13:01  book\src\cn\edu\njxzc\soft03\controller\BrrowController.java
     文件        1299  2016-06-17 15:44  book\src\cn\edu\njxzc\soft03\controller\PrivController.java
     文件        1641  2016-06-21 11:36  book\src\cn\edu\njxzc\soft03\controller\PrivInterceptor.java
     文件        2528  2016-06-23 09:51  book\src\cn\edu\njxzc\soft03\controller\UserController.java
............此处省略1596个文件信息

评论

共有 条评论