package com.hao.controller;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
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.hao.service.StudentService;
@Controller
public class StudentController {
@Autowired
private StudentService studentService;
@RequestMapping("list")
public ModelAndView list() {
ModelAndView mv = new ModelAndView();
List<Map<String , Object>> studentList = studentService.findStudentList();
System.out.println("studentList"+studentList);
mv.addObject("studentList",studentList);
mv.setViewName("list");
return mv;
}
@RequestMapping("toAdd")
public ModelAndView toAdd() {
ModelAndView mv = new ModelAndView();
mv.setViewName("add");
return mv;
}
}
尊严丢了,整个人就破产了。
《李茶的姑妈》