• 大小: 12.45MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-22
  • 语言: 数据库
  • 标签: Springmvc  

资源简介

基于Springmvc、mybaits的简单课程设计购物网站,使用Springmvc框架,mysql数据库

资源截图

代码片段和文件信息

package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

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 po.AdminCustom;
import service.AdminService;

@Controller
public class AdminController {
    

@Autowired
private AdminService adminService;
  
  //登陆
@RequestMapping(value=“/adminlogin“) 
public ModelAndView adminlogin() throws Exception{
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(“admin/adminlogin“);
return modelAndView;
}

//获得admin名称
@RequestMapping(“/adminloginSumbit“) 
  public ModelAndView adminloginSumbit(HttpSession session AdminCustom adminCustom) throws Exception { 

AdminCustom adminCustom1 = adminService.adminVerification(adminCustom);
if(adminCustom1!=null)
{

adminService.adminVerification(adminCustom);
  ModelAndView modelAndView = new ModelAndView();
  modelAndView.addobject(“adminname“ adminCustom.getAdminname());  
modelAndView.setViewName(“redirect:/goods/queryGoods“);
return modelAndView;
}
else
{
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(“admin/adminlogin“);
return modelAndView;
}
 

/*adminService.adminVerification(adminCustom);
  ModelAndView modelAndView = new ModelAndView();
  
  modelAndView.addobject(“adminname“ adminCustom.getAdminname());
  
modelAndView.setViewName(“redirect:/goods/queryGoods“);
return modelAndView;*/
  }


// 退出
@RequestMapping(“/adminlogout“)
public String adminlogout(HttpSession session) throws Exception {
session.invalidate();
return “adminlogin“;
}



//注册
@RequestMapping(“/adminregister“)
public  ModelAndView adminregister() throws Exception{
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(“admin/adminregister“);
return modelAndView;
}

@RequestMapping(“/adminregisterSumbit“) 
  public ModelAndView adminregistSumbit(HttpSession session AdminCustom adminCustom
  ) throws Exception {  

       adminService.addAdmin(adminCustom);
  session.setAttribute(“adminname“ adminCustom.getAdminname());
  ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(“admin/adminlogin“);
return modelAndView;

  }

@RequestMapping(“/adminexist“)
public void exist(String adminnameHttpServletRequest requestHttpServletResponse response) throws Exception 

{
AdminCustom adminCustom=adminService.adminisExist(adminname);
String json;
if(adminCustom!=null)
{
String result=“true“;
json=“{\“result\“:\““+result+“\“}“;
}
else
{
String result=“false“;
json=“{\“result\“:\““+res

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       12885  2016-06-29 10:43  shopping.sql
     目录           0  2016-05-25 08:19  springmvc_mybatis\
     文件        3572  2016-05-26 21:06  springmvc_mybatis\.classpath
     目录           0  2016-06-29 10:42  springmvc_mybatis\.myeclipse\
     文件         324  2016-05-27 09:23  springmvc_mybatis\.mymetadata
     文件        1760  2016-04-13 10:36  springmvc_mybatis\.project
     目录           0  2016-05-25 08:19  springmvc_mybatis\.settings\
     文件         500  2016-04-12 15:31  springmvc_mybatis\.settings\.jsdtscope
     文件         111  2016-04-20 19:27  springmvc_mybatis\.settings\org.eclipse.core.resources.prefs
     文件         395  2016-04-12 15:31  springmvc_mybatis\.settings\org.eclipse.jdt.core.prefs
     文件         566  2016-04-12 15:33  springmvc_mybatis\.settings\org.eclipse.wst.common.component
     文件         252  2016-04-12 15:31  springmvc_mybatis\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-04-12 15:31  springmvc_mybatis\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-04-12 15:31  springmvc_mybatis\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-05-25 08:19  springmvc_mybatis\WebRoot\
     目录           0  2016-05-25 08:19  springmvc_mybatis\WebRoot\meta-INF\
     文件          36  2016-04-12 15:31  springmvc_mybatis\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2016-05-25 08:19  springmvc_mybatis\WebRoot\WEB-INF\
     目录           0  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\
     目录           0  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\
     文件        3548  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\AdminController.class
     文件        2527  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\CatelogController.class
     文件       12929  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\GoodsController.class
     文件        3582  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\LiuyanController.class
     文件        7403  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\OrderController.class
     文件         609  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\OrderitemController.class
     文件        5927  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\controller\UserController.class
     文件         159  2016-05-26 19:05  springmvc_mybatis\WebRoot\WEB-INF\classes\db.properties
     文件         270  2016-04-12 15:35  springmvc_mybatis\WebRoot\WEB-INF\classes\log4j.properties
     目录           0  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\mapper\
     文件         817  2016-05-27 09:24  springmvc_mybatis\WebRoot\WEB-INF\classes\mapper\AdminMapper.class
............此处省略249个文件信息

评论

共有 条评论