我没有从控制器到jsp页面获取所有表列表

时间:2019-10-05 07:09:53

标签: spring jsp jdbc

这是在岛上,就像这样:

public List<Tables> getTablesList(){
            List<Tables> list=jdbcTemplate.query(Queries.GET_USER_DATATABLES,new RowMapper<Tables>(){
`like so`
                @Override
                public Tables mapRow(ResultSet rs, int rowNum) throws SQLException {
                    // TODO Auto-generated method stub
                    Tables table=new Tables();
                    while(rs.next()) {
                        table.setTables_in_mydb(rs.getString("Tables_in_mydb"));
                      System.out.println("Hi"+table.toString());
                    }
                    return table;

                }

            });
            return list;
        }

这在控制器中:

@RequestMapping(value = "/list")
    public String getuser(Model model){    
        List<Tables> user=userdao.getTablesList();    
      model.addAttribute("list",user); 

        return "get-user-table";

    }   

0 个答案:

没有答案