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

资源简介

这是一个ssm的网上商城项目,里面有数据库文件,名字是shop,登录的时候记得使用shop,文档里是sheji_3,这是个基本完整的项目,运行没有任何问题

资源截图

代码片段和文件信息

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“;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-10 15:15  shop\
     文件        1411  2018-04-08 09:56  shop\.classpath
     目录           0  2018-04-10 15:33  shop\.myeclipse\
     文件         288  2018-04-08 09:55  shop\.mymetadata
     文件        1747  2018-04-10 15:19  shop\.project
     目录           0  2018-04-10 15:09  shop\.settings\
     文件         500  2016-12-11 10:22  shop\.settings\.jsdtscope
     文件          74  2017-01-01 15:17  shop\.settings\com.genuitec.eclipse.core.prefs
     文件         247  2018-04-08 09:56  shop\.settings\com.genuitec.eclipse.migration.prefs
     文件         364  2016-12-11 10:22  shop\.settings\org.eclipse.jdt.core.prefs
     文件         615  2018-04-10 15:19  shop\.settings\org.eclipse.wst.common.component
     文件         615  2018-04-10 15:09  shop\.settings\org.eclipse.wst.common.component.bak
     文件         621  2018-04-10 15:09  shop\.settings\org.eclipse.wst.common.component.bak.bak
     文件         359  2018-04-08 09:56  shop\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-12-11 10:22  shop\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-12-11 10:22  shop\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-04-08 09:56  shop\WebRoot\
     目录           0  2018-04-08 09:56  shop\WebRoot\meta-INF\
     文件          36  2016-12-11 10:22  shop\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2018-04-08 09:56  shop\WebRoot\WEB-INF\
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\meta-INF\
     文件          25  2018-04-08 09:56  shop\WebRoot\WEB-INF\classes\meta-INF\MANIFEST.MF
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\
     目录           0  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\
     文件        3364  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\AdminController.class
     文件        3389  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\AdsController.class
     文件        3580  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\CartController.class
     文件        2190  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\CityController.class
............此处省略572个文件信息

评论

共有 条评论