Thymeleaf模板引擎

<!--suppress ALL-->  
 在thymeleaf   html标签下中加入,使其不报红色警告
//前后端不分离返回数据
@RequestMapping("list")
public ModelAndView list() {
    ModelMap modelMap = new ModelMap();
   modelMap.put("data", bookService.selectAllBook());
    return new ModelAndView("book", modelMap);
}
//给前端ajax的success值
    @ResponseBody
    @RequestMapping("test")
    public Object query(Student student) {
        List<Student> students = studentService.select(student);
        Map<String, Object> map = new HashMap<>();
        map.put("result", students);
        return map;
    }

版权声明:本文为tylt6688原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。