SpringBoot 查询到mysql数据,用bootstrap table表格渲染不显示数据

问题遇到的现象和发生背景

SpringBoot 查询到mysql数据,用bootstrap table表格渲染不显示数据,请大家帮忙看看,谢谢

img

img

问题相关代码,请勿粘贴截图
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charshttps://img-mid.csdnimg.cn/release/static/image/mid/ask/640343652956179.png "#left")
et="UTF-8">
  <title>bootstrap-table使用</title>
<!--  <link rel="stylesheet" type="text/css" href="js/bootstrap.min.css" />-->
<!--  <link rel="stylesheet" type="text/css" href="js/bootstrap-table.css" />-->
  <script src="js/jquery.js"></script>
  
</head>
<body>
<table id="tb_departments" data-toggle="table"></table>
</body>
<script type="text/javascript">
  $(function(){
    var oTable = TableInit();
    oTable.Init();
  });

  function TableInit() {
    var oTableInit = new Object();
    //初始化Table
    oTableInit.Init = function() {
      $('#tb_departments').bootstrapTable({
        url: "stu",
        pagination: true, //分页
        search: false, //显示搜索框
        sidePagination: "server", //服务端处理分页
        pageNumber: 1, //初始化加载第一页,默认第一页
        pageSize: 5, //每页的记录行数(*)
        responseHandler:function(res) {
          console.log("rows"+res.rows);
          return {
            "total":res.total, //总页数
            "rows": res.rows   //数据
          }
        },
        columns: [

          {
            title: '姓名',
            field: 'sname',
            align: 'center',
            valign: 'middle',
          },
          {
            title: '性别',
            field: 'ssex',
            align: 'center',
            valign: 'middle',
          },
          {
            title: '年龄',
            field: 'sage',
            align: 'center',
            valign: 'middle',
          },
          {
            title: '唯一标识',
            field: 'sid',
            align: 'center',
            valign: 'middle',
          }
        ]
      });
    };
    return oTableInit;
  };
</script>

<script src="js/bootstrap-table/bootstrap-table.min.js"></script>
<script src="js/bootstrap-table/bootstrap-table-zh-CN.js"></script>
</html>

package com.example.demo.controller;

import com.example.demo.entity.Student;
import com.example.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class StudentController {

    @Autowired
    StudentService studentService;

    @RequestMapping("/stu")
    public Map findAll(){
        System.out.println("访问stu");
        List list = studentService.findAll();
        Map<String,Object>  map = new HashMap<String,Object>();
        map.put("total",list.size());
        map.put("rows",list);
        return map;
    }

    @RequestMapping("/login")
    public String PrintMsg(){
        return "login.jsp";
    }
}

package com.example.demo.service;

import com.example.demo.entity.Student;
import com.example.demo.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentMapper studentMapper;

    public List<Student> findAll(){
        return studentMapper.findAll();
    }
}


package com.example.demo.mapper;

import com.example.demo.entity.Student;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface StudentMapper {
    List<Student> findAll();
}

运行结果及报错内容

img

img

我的解答思路和尝试过的方法

分页的total和rows已添加

我想要达到的结果

表格正常显示查询到的数据