资源简介
此系统是用myeclipse10开发的。完成了大部分网上书店系统的功能架构。适合学习javaee框架。
代码片段和文件信息
package org.bookstore.acton;
import org.bookstore.service.IBookService;
import org.hibernate.mapping.List;
import org.hibernate.mapping.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class BookAction extends ActionSupport {
protected ICatalogService catalogService;
public void setCatalogService(ICatalogService catalogService) {
this.catalogService = catalogService;
}
protected IBookService bookService;
public void setBookService(IBookService bookService) {
this.bookService = bookService;
}
private String bookname;// 根据输入的书名或部分书名查询
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
protected Integer catalogid;// 获得图书类别的ID
private Integer currentPage = 1;// 当前页
// 生成当前页的get和set方法
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
// 生成图书ID的get和set方法
public Integer getCatalogid() {
return catalogid;
}
public void setCatalogid(Integer catalogid) {
this.catalogid = catalogid;
}
// 方法实现
public String browseBookPaging() throws Exception {
int totalSize = bookService.getTotalByCatalog(catalogid);
System.out.println(catalogid);
Pager pager = new Pager(currentPage totalSize);
List books = bookService.getBookByCatalogidPaging(catalogid
currentPage pager.getPageSize());
Map request = (Map) ActionContext.getContext().get(“request“);
request.put(“books“ books);
request.put(“pager“ pager);
// 购物车要返回继续购买时需要记住返回的地址
Map session = ActionContext.getContext().getSession();
request.put(“catalogid“ catalogid);
return SUCCESS;
}
public String searchBook() throws Exception {
List books = bookService.getRequiredBookByName(this.getBookname());
Map request = (Map) ActionContext.getContext().get(“request“);
System.out.println(bookname);
request.put(“books“ books);
return SUCCESS;
}
public String browseCatalog() throws Exception {
List catalogs = catalogService.getAllCatalogs();
Map request = (Map) ActionContext.getContext().get(“request“);
request.put(“catalogs“ catalogs);
return SUCCESS;
}
public String newBook() throws Exception {
List books = bookService.getNewBook();
Map request = (Map) ActionContext.getContext().get(“request“);
request.put(“books“ books);
return SUCCESS;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-19 14:26 bookstore\
文件 1401 2013-12-19 10:39 bookstore\.classpath
目录 0 2013-12-19 14:26 bookstore\.myeclipse\
文件 533 2013-12-19 10:55 bookstore\.myhibernatedata
文件 300 2013-12-19 09:54 bookstore\.myme
文件 1946 2013-12-19 10:39 bookstore\.project
目录 0 2013-12-19 14:26 bookstore\.settings\
文件 500 2013-12-19 09:54 bookstore\.settings\.jsdtscope
文件 364 2013-12-19 09:54 bookstore\.settings\org.eclipse.jdt.core.prefs
文件 465 2013-12-19 09:54 bookstore\.settings\org.eclipse.wst.common.component
文件 252 2013-12-19 09:54 bookstore\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2013-12-19 09:54 bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-12-19 09:54 bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 462 2013-12-19 10:39 bookstore\.springBeans
目录 0 2013-12-19 14:26 bookstore\WebRoot\
目录 0 2013-12-19 14:26 bookstore\WebRoot\me
文件 39 2013-12-19 10:46 bookstore\WebRoot\me
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\classes\
文件 3246 2013-12-19 13:59 bookstore\WebRoot\WEB-INF\classes\applicationContext.xm
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\classes\org\
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\classes\org\bookstore\
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\classes\org\bookstore\acton\
文件 3224 2013-12-19 13:19 bookstore\WebRoot\WEB-INF\classes\org\bookstore\acton\BookAction.class
文件 2347 2013-12-19 14:16 bookstore\WebRoot\WEB-INF\classes\org\bookstore\acton\ShoppingAction.class
文件 2218 2013-12-19 12:02 bookstore\WebRoot\WEB-INF\classes\org\bookstore\acton\UserAction.class
目录 0 2013-12-19 14:26 bookstore\WebRoot\WEB-INF\classes\org\bookstore\dao\
文件 466 2013-12-19 13:12 bookstore\WebRoot\WEB-INF\classes\org\bookstore\dao\IBookDAO.class
文件 179 2013-12-19 13:22 bookstore\WebRoot\WEB-INF\classes\org\bookstore\dao\ICatalogDAO.class
文件 309 2013-12-19 11:29 bookstore\WebRoot\WEB-INF\classes\org\bookstore\dao\IUserDAO.class
文件 198 2013-12-19 13:40 bookstore\WebRoot\WEB-INF\classes\org\bookstore\dao\IorderDAO.class
............此处省略198个文件信息
- 上一篇:人力资源管理系统源码+数据库源码
- 下一篇:javaweb 通用权限管理系统
评论
共有 条评论