资源简介

网上商城(Springmvc+Spring+Hibernate) 包括会员管理,商品管理,订单管理等模块,功能较齐全 前台访问地址:http://localhost:8080/eShop/ 后台访问地址:http://localhost:8080/eShop/adminIndex 管理员姓名:admin 管理员密码:admin

资源截图

代码片段和文件信息

package com.shop.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.shop.model.Category;
import com.shop.service.AdminCategoryService;

@Controller
public class AdminCategoryController {

@Resource
private AdminCategoryService adminCategoryService;

@ModelAttribute(“category“)
public void getCategory(@RequestParam(value=“cid“required=false)Integer cid Mapject> map) {
if(cid != null){
Category category = adminCategoryService.findCategory(cid);
map.put(“category“ category);
}
}

//修改一级分类
@RequestMapping(value=“/updateCategory“)
public ModelAndView updateCategory(@ModelAttribute(“category“) Category category){
adminCategoryService.updateCategory(category);
ModelAndView modelAndView = new ModelAndView(“redirect:/listCategory/1“);
return modelAndView;
}

//跳转到修改一级分类
@RequestMapping(value=“/gotoEditCategory/{cid}“)
public String gotoEditCategory(@PathVariable(“cid“) Integer cidMapject> map){
Category category  = adminCategoryService.findCategory(cid);
map.put(“category“category);
return “admin/category/edit“;
}

//删除一级分类
@RequestMapping(value=“/deleteCategory/{cid}/{page}“)
public ModelAndView deleteCategory(@PathVariable(“cid“) Integer cid@PathVariable(“page“) Integer page){
adminCategoryService.deleteCategory(cid);
ModelAndView modelAndView = new ModelAndView(“redirect:/listCategory/“ + page);
return modelAndView;
}

//添加一级分类,cname为前台传过来的一级分类的名称
@RequestMapping(value=“/addCategory“)
public ModelAndView addCategory(@RequestParam(value=“cname“required=true) String cname){
//创建一级分类的对象
Category category = new Category();
category.setCname(cname);
adminCategoryService.addCategory(category);
ModelAndView modelAndView = new ModelAndView(“redirect:listCategory/1“);
return modelAndView;
}

//跳转到添加一级分类
@RequestMapping(value=“/gotoAddCategory“)
public String gotoAddCategory(){
return “admin/category/add“;
}

//查询一级分类
@RequestMapping(value=“/listCategory/{page}“)
public String listCategory(@PathVariable(“page“) Integer pageMapject> map){
List categorys = adminCategoryService.listCategory(page);
map.put(“categorys“ categorys);
map.put(“page“ page);
//查询一级分类的页数
Integer count = adminCategoryService.countCategory();
map.put(“count“ count);
return “admin/category/list“;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-01-18 13:36  eShop\
     文件        4288  2015-11-24 09:50  eShop\.classpath
     目录           0  2016-01-18 13:39  eShop\.myeclipse\
     文件         288  2015-11-23 17:07  eShop\.mymetadata
     文件        1411  2015-11-24 09:49  eShop\.project
     目录           0  2016-01-18 13:36  eShop\.settings\
     文件         500  2015-11-23 17:07  eShop\.settings\.jsdtscope
     文件         330  2015-11-23 17:07  eShop\.settings\org.eclipse.jdt.core.prefs
     文件          49  2015-11-23 17:07  eShop\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2015-11-23 17:07  eShop\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-01-18 13:36  eShop\WebRoot\
     目录           0  2016-01-18 13:36  eShop\WebRoot\meta-INF\
     文件          36  2015-11-23 17:07  eShop\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\classes\
     文件        2622  2016-01-18 10:46  eShop\WebRoot\WEB-INF\classes\applicationContext.xml
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\classes\com\
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\classes\com\shop\
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\
     文件        4023  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\AdminCategoryController.class
     文件        4960  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\AdminCategorySecondController.class
     文件        4813  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\AdminController.class
     文件        3824  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\AdminOrderController.class
     文件        6750  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\AdminProductController.class
     文件        2370  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\CartController.class
     文件        3439  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\CheckImgController.class
     文件        1613  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\IndexController.class
     文件        8453  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\OrderController.class
     文件        2856  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\ProductController.class
     文件        6257  2016-01-18 11:36  eShop\WebRoot\WEB-INF\classes\com\shop\controller\UserController.class
     目录           0  2016-01-18 13:36  eShop\WebRoot\WEB-INF\classes\com\shop\dao\
............此处省略469个文件信息

评论

共有 条评论