资源简介

该文件是基于SSH开发的一个比较简易的校园购物网站,实现了用户登录、注册、查询商品、购买商品、生成订单、修改个人资料以及上架、下架商品,和后台管理的功能,当然之间存在很多Bug和很多未处理的问题,比如一些出错页面提示没有写,仅供参考

资源截图

代码片段和文件信息

package campus.action;

import campus.domain.Admin;
import campus.domain.PageBean;
import campus.domain.Product;
import campus.domain.User;
import campus.service.AdminService;
import campus.service.ProductService;
import campus.userservice.UserService;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class AdminAction extends ActionSupport implements ModelDriven {
private Admin admin=new Admin();
@Override
public Admin getModel() {
// TODO Auto-generated method stub
return admin;
}

private AdminService adminService;


public void setAdminService(AdminService adminService) {
this.adminService = adminService;
}


public String login(){

Admin existadmin=adminService.adlogin(admin);
System.out.println(admin.getAdminname()+admin.getAdpassword());
if(existadmin==null){
System.out.println(“登录失败“);
this.addActionerror(“管理员不存在!“);
return INPUT;
}else{
System.out.println(“登录成功“);
ActionContext.getContext().getSession().put(“loginadmin“ existadmin);
return SUCCESS;
}
}

private UserService userService;

public void setUserService(UserService userService) {
this.userService = userService;
}

private Integer currpage=1;

public void setCurrpage(Integer currpage) {
this.currpage = currpage;
}

public String findAllUser(){
PageBean pagebean=userService.findByPage(currpage);
ActionContext.getContext().getValueStack().push(pagebean);
return “findallusersuccess“;
}

private ProductService productService;

public void setProductService(ProductService productService) {
this.productService = productService;
}


public String findAllProduct(){
PageBean pagebean=productService.findByPage(currpage);
ActionContext.getContext().getValueStack().push(pagebean);
return “findallproductsuccess“;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-04 12:17  CampusShopping\
     文件        1093  2018-05-20 12:13  CampusShopping\.classpath
     文件        1197  2018-05-20 12:13  CampusShopping\.project
     目录           0  2018-06-04 12:17  CampusShopping\.settings\
     文件         522  2018-05-20 12:13  CampusShopping\.settings\.jsdtscope
     文件         364  2018-05-20 12:13  CampusShopping\.settings\org.eclipse.jdt.core.prefs
     文件         501  2018-05-20 12:13  CampusShopping\.settings\org.eclipse.wst.common.component
     文件         414  2018-05-20 12:13  CampusShopping\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-05-20 12:13  CampusShopping\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-05-20 12:13  CampusShopping\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          66  2018-05-20 12:13  CampusShopping\.tern-project
     目录           0  2018-06-04 12:17  CampusShopping\src\
     文件        4387  2018-05-31 12:50  CampusShopping\src\applicationContext.xml
     目录           0  2018-06-04 12:17  CampusShopping\src\campus\
     目录           0  2018-06-04 12:17  CampusShopping\src\campus\action\
     文件        1998  2018-05-26 21:58  CampusShopping\src\campus\action\AdminAction.java
     文件        1115  2018-05-25 21:32  CampusShopping\src\campus\action\IndexAction.java
     文件        3877  2018-05-31 23:22  CampusShopping\src\campus\action\OrderFormAction.java
     文件        4959  2018-05-31 21:43  CampusShopping\src\campus\action\ProductAction.java
     目录           0  2018-06-04 12:17  CampusShopping\src\campus\dao\
     文件         122  2018-05-26 19:05  CampusShopping\src\campus\dao\AdminDao.java
     目录           0  2018-06-04 12:17  CampusShopping\src\campus\dao\Imp\
     文件         569  2018-05-26 19:21  CampusShopping\src\campus\dao\Imp\AdminDaoImp.java
     文件         111  2018-05-22 14:41  CampusShopping\src\campus\dao\Imp\IndexDaoImp.java
     文件        1232  2018-05-31 23:25  CampusShopping\src\campus\dao\Imp\OrderDaoImp.java
     文件        2515  2018-06-03 11:25  CampusShopping\src\campus\dao\Imp\ProductDaoImp.java
     文件          57  2018-05-22 14:40  CampusShopping\src\campus\dao\IndexDao.java
     文件         290  2018-05-31 23:23  CampusShopping\src\campus\dao\OrderDao.java
     文件         587  2018-05-30 23:18  CampusShopping\src\campus\dao\ProductDao.java
     目录           0  2018-06-04 12:17  CampusShopping\src\campus\domain\
     文件         592  2018-05-26 18:47  CampusShopping\src\campus\domain\admin.hbm.xml
............此处省略171个文件信息

评论

共有 条评论