资源简介

这是一个SSM网上商城项目,里面有包括商城页面,和后台管理页面。项目可以流畅运行,可以作为毕业设计参考,你们懂得。有一些小页面我没有做,你们需要的话,可以自行完善

资源截图

代码片段和文件信息

package com.hzyc.practice.controllers;

import java.io.File;
import java.io.IOException;
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.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import com.hzyc.practice.models.Advertise;
import com.hzyc.practice.service.AdsServiceInterface;
import com.hzyc.practice.tools.DateTools;

@Controller
@RequestMapping(“AdsController“)
public class AdsController {
@Autowired
private AdsServiceInterface service;
@RequestMapping(“insertAds.do“)
public String insertAds(MultipartFile fileHttpServletRequest request){
//获取上传图片的路径
String path=request.getSession().getServletContext().getRealPath(“/pictures“);

//插入数据库
Advertise ads = new Advertise();
//根据当前时间产生图片名称
ads.setName(new DateTools().createName(file.getOriginalFilename()));
service.insertAds(ads);
//上传文件
try {
file.transferTo(new File(path+File.separator+ads.getName()));
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return “../admin/success.jsp“;
}
@RequestMapping(“selectAds.do“)
public ModelAndView selectAds(){
List aList = service.selectAds();
ModelAndView andView = new ModelAndView();
andView.addobject(“aList“ aList);
andView.setViewName(“../admin/topAds.jsp“);
return andView;
}
@RequestMapping(“deleteAds.do“)
public String deleteAds(Advertise ads){
service.deleteAds(ads);
return “selectAds.do“;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-14 09:20  shop\
     文件        1411  2018-04-08 09:56  shop\.classpath
     目录           0  2018-04-14 18:21  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-14 09:03  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\
     文件        3335  2018-04-10 17:09  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
     文件        2025  2018-04-10 15:19  shop\WebRoot\WEB-INF\classes\com\hzyc\practice\controllers\CommentController.class
............此处省略581个文件信息

评论

共有 条评论