• 大小: 10.89MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-10-06
  • 语言: 其他
  • 标签: SSM  

资源简介

SSM实现增删改查,eclipse编写的,可以直接导入使用.....

资源截图

代码片段和文件信息

package com.ccut.controller;

import java.util.List;

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

import com.ccut.page.Page;
import com.ccut.pojo.Student;
import com.ccut.service.StudentService;

@org.springframework.stereotype.Controller
@RequestMapping(““)
public class StudentController {
@Autowired
StudentService studentService;

@RequestMapping(“listStudent“)
public ModelAndView listStudent() {
ModelAndView modelAndView = new ModelAndView();
// 业务逻辑的实现
List ls = studentService.list();
modelAndView.addobject(“cs“ ls);
modelAndView.setViewName(“listStudent“);
return modelAndView;
}

@RequestMapping(“listStudentBypage“)
public ModelAndView listStudentBypage(Page page) {
ModelAndView modelAndView = new ModelAndView();
// 业务逻辑的实现
List ls = studentService.list(page);
int total = studentService.total();
page.caculateLast(total);
modelAndView.addobject(“cs“ ls);
modelAndView.setViewName(“listStudent“);
return modelAndView;
}

// 增加
@RequestMapping(“addStudent“)
public ModelAndView addStudent(Student student) {
studentService.add(student);
ModelAndView mav = new ModelAndView(“redirect:/listStudentBypage“);
return mav;
}

// 删除
@RequestMapping(“deleteStudent“)
public ModelAndView deleteStudent(Student student) {
studentService.delete(student);
ModelAndView mav = new ModelAndView(“redirect:/listStudentBypage“);
return mav;
}
   //修改先通过get方法得到一个对象
@RequestMapping(“editStudent“)
public ModelAndView editStudent(Student student) {
Student st = studentService.get(student.getId());
System.out.println(st.toString());
ModelAndView mav = new ModelAndView(“editStudent“);
mav.addobject(“c“st);
return mav;
}

// 修改
@RequestMapping(“updateStudent“)
public ModelAndView updateStudent(Student student) {
        studentService.update(student);
ModelAndView mav = new ModelAndView(“redirect:/listStudentBypage“);
return mav;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-09 16:18  feifeiSSMDemo\
     文件         588  2018-04-09 16:18  feifeiSSMDemo\.classpath
     文件        1046  2018-04-09 16:18  feifeiSSMDemo\.project
     目录           0  2018-04-09 16:18  feifeiSSMDemo\.settings\
     文件         503  2018-04-09 16:18  feifeiSSMDemo\.settings\.jsdtscope
     文件         395  2018-04-09 16:18  feifeiSSMDemo\.settings\org.eclipse.jdt.core.prefs
     文件         493  2018-04-09 16:18  feifeiSSMDemo\.settings\org.eclipse.wst.common.component
     文件         305  2018-04-09 16:18  feifeiSSMDemo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-04-09 16:18  feifeiSSMDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-04-09 16:18  feifeiSSMDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-04-09 16:18  feifeiSSMDemo\build\
     目录           0  2018-04-10 14:27  feifeiSSMDemo\build\classes\
     文件        2107  2018-04-10 14:24  feifeiSSMDemo\build\classes\applicationContext.xml
     目录           0  2018-04-09 20:12  feifeiSSMDemo\build\classes\com\
     目录           0  2018-04-10 15:12  feifeiSSMDemo\build\classes\com\ccut\
     目录           0  2018-04-10 14:43  feifeiSSMDemo\build\classes\com\ccut\controller\
     文件        2877  2018-04-10 20:25  feifeiSSMDemo\build\classes\com\ccut\controller\StudentController.class
     目录           0  2018-04-10 16:57  feifeiSSMDemo\build\classes\com\ccut\mapper\
     文件         512  2018-04-10 16:56  feifeiSSMDemo\build\classes\com\ccut\mapper\StudentMapper.class
     文件         984  2018-04-10 16:57  feifeiSSMDemo\build\classes\com\ccut\mapper\StudentMapper.xml
     目录           0  2018-04-10 15:12  feifeiSSMDemo\build\classes\com\ccut\page\
     文件        1024  2018-04-10 15:56  feifeiSSMDemo\build\classes\com\ccut\page\Page.class
     目录           0  2018-04-09 20:12  feifeiSSMDemo\build\classes\com\ccut\pojo\
     文件        1016  2018-04-09 20:12  feifeiSSMDemo\build\classes\com\ccut\pojo\Student.class
     目录           0  2018-04-09 20:34  feifeiSSMDemo\build\classes\com\ccut\service\
     目录           0  2018-04-09 20:35  feifeiSSMDemo\build\classes\com\ccut\service\impl\
     文件        1743  2018-04-10 17:04  feifeiSSMDemo\build\classes\com\ccut\service\impl\StudentServiceImpl.class
     文件         493  2018-04-10 17:04  feifeiSSMDemo\build\classes\com\ccut\service\StudentService.class
     目录           0  2018-04-09 20:12  feifeiSSMDemo\build\classes\com\ccut\test\
     文件        1907  2018-04-10 15:37  feifeiSSMDemo\build\classes\com\ccut\test\MybatisTest.class
     文件         333  2018-04-09 16:27  feifeiSSMDemo\build\classes\log4j.properties
............此处省略59个文件信息

评论

共有 条评论