• 大小: 18.89MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-19
  • 语言: 数据库
  • 标签: 网上商城  

资源简介

ssm+mysql的网上商城系统,前台商品的展示,添加购物车,结算,商品评价;后台添加商品信息及图片,广告管理,基本的统计功能

资源截图

代码片段和文件信息

package com.hzyc.practice.controllers;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.hzyc.practice.models.Admin;
import com.hzyc.practice.service.AdminServiceInterface;

@Controller
@RequestMapping(“AdminController“)
public class AdminController {
@Autowired
private AdminServiceInterface service;
@RequestMapping(“addAdmin.do“)
public String addAdmin(Admin admin){
service.addAdmin(admin);
return “../admin/success.jsp“;
}

@RequestMapping(“selectAdmin.do“)
//获取所有类别,并传到listType.jsp
public ModelAndView selectAllType(Admin admin){
List list = service.selectAdmin(admin);
ModelAndView andView = new ModelAndView();
andView.setViewName(“../admin/listAdmin.jsp“);
andView.addobject(“list“list);
return andView;
}
@RequestMapping(“editAdmin.do“)
//在listType页面点击修改后进入这里根据id找到相应的type,传给editType.jsp
public ModelAndView editType(HttpServletRequest request){
System.out.println(“edit---------------------“);
String id=request.getParameter(“id“);
System.out.println(“id---------------“+id);
Admin admin=new Admin();
admin.setId(Integer.parseInt(id));
//根据id获取整个type的信息
List list=service.selectAdmin(admin);
ModelAndView andView = new ModelAndView();
andView.addobject(“admin“list.get(0));
andView.setViewName(“../admin/editAdmin.jsp“);
return andView;
}
@RequestMapping(“updateAdmin.do“)
//修改商品类别,执行完后跳向selectAdmin.do,显示修改后的结果
public String updateAdmin(Admin admin){
service.updateAdmin(admin);
return “redirect:selectAdmin.do“;
}
@RequestMapping(“deleteAdmin.do“)
public String deleteType(HttpServletRequest request){
String id=request.getParameter(“id“);
Admin admin = new Admin();
admin.setId(Integer.parseInt(id));
//删除
service.deleteAdmin(admin);
return “redirect:selectAdmin.do“;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       57695  2017-03-20 10:21  sheji.sql
     目录           0  2017-03-20 10:19  sheji_3\
     文件         740  2017-01-01 20:49  sheji_3\.classpath
     目录           0  2016-12-11 10:22  sheji_3\.myeclipse\
     文件         294  2017-03-20 10:12  sheji_3\.mymetadata
     文件        1750  2017-03-20 10:12  sheji_3\.project
     目录           0  2017-03-20 10:19  sheji_3\.settings\
     文件         500  2016-12-11 10:22  sheji_3\.settings\.jsdtscope
     文件          74  2017-01-01 15:17  sheji_3\.settings\com.genuitec.eclipse.core.prefs
     文件         364  2016-12-11 10:22  sheji_3\.settings\org.eclipse.jdt.core.prefs
     文件         536  2017-03-20 10:12  sheji_3\.settings\org.eclipse.wst.common.component
     文件         252  2016-12-11 10:22  sheji_3\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-12-11 10:22  sheji_3\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-12-11 10:22  sheji_3\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2017-03-20 10:19  sheji_3\config\
     文件         169  2017-01-08 16:00  sheji_3\config\db.properties
     文件         277  2016-11-12 15:15  sheji_3\config\log4j.properties
     目录           0  2017-03-20 10:19  sheji_3\config\mybatis\
     文件         318  2016-12-11 10:29  sheji_3\config\mybatis\SqlMapConfig.xml
     目录           0  2017-03-20 10:19  sheji_3\config\spring\
     文件        2230  2016-12-11 21:26  sheji_3\config\spring\applicationContext-mybatis.xml
     文件        2183  2016-12-11 21:26  sheji_3\config\spring\applicationContext-transaction.xml
     文件        2098  2017-01-02 18:57  sheji_3\config\spring\spring_mvc.xml
     目录           0  2017-03-20 10:19  sheji_3\src\
     目录           0  2017-03-20 10:19  sheji_3\src\com\
     目录           0  2017-03-20 10:19  sheji_3\src\com\hzyc\
     目录           0  2017-03-20 10:19  sheji_3\src\com\hzyc\practice\
     目录           0  2017-03-20 10:19  sheji_3\src\com\hzyc\practice\controllers\
     文件        2169  2016-12-15 20:00  sheji_3\src\com\hzyc\practice\controllers\AdminController.java
     文件        1885  2017-01-09 15:35  sheji_3\src\com\hzyc\practice\controllers\AdsController.java
     文件        3082  2017-01-11 20:34  sheji_3\src\com\hzyc\practice\controllers\CartController.java
............此处省略564个文件信息

评论

共有 条评论