Struts2实现分页

时间:2018-06-19 13:45:42
【文件属性】:

文件名称:Struts2实现分页

文件大小:4.01MB

文件格式:ZIP

更新时间:2018-06-19 13:45:42

分页显示

struts实现数据库添删改查,以及分页 ArrayList list; UserService service; Users user; Pager page=new Pager(); public Pager getPage() { return page; } public void setPage(Pager page) { this.page = page; } public Users getUser() { return user; } public void setUser(Users user) { this.user = user; } public ArrayList getList() { return list; } public void setList(ArrayList list) { this.list = list; } public String lists() { service = new UserService(); // list=service.getAllUsers(); System.out.println("page.pageNow="+page.getPageNow()); list = service.getUsersByPage(page.getPageNow(), page.getPageSize()); return Action.SUCCESS; } public String input() { service = new UserService(); if (user != null) { user = service.getUsersByname(user); System.out.println(user.toString()); } return Action.SUCCESS; } public String save() { service = new UserService(); if (user != null && user.getCdate() != null) { service.updateUsers(user); System.out.println(user.toString()); } else { service.addUsers(user); } return Action.SUCCESS; } public String deleteusers() { service = new UserService(); service.delUsers(user); return Action.SUCCESS; }

用户名密码权限日期操作
">修改     ">删除
添加用户
">首页 ">上一页 ">下一页 ">尾页


【文件预览】:
Lession_03_3
----.project(1KB)
----WebContent()
--------WEB-INF()
--------userslist.jsp(1KB)
--------welcome.jsp(402B)
--------usersForm.jsp(755B)
--------META-INF()
----src()
--------struts.xml(983B)
--------com()
----.settings()
--------org.eclipse.wst.jsdt.ui.superType.container(49B)
--------org.eclipse.wst.common.project.facet.core.xml(345B)
--------org.eclipse.jdt.core.prefs(364B)
--------org.eclipse.wst.jsdt.ui.superType.name(6B)
--------org.eclipse.wst.common.component(490B)
--------.jsdtscope(503B)
----build()
--------classes()
----.classpath(841B)

网友评论