springmvc放进model中的数据,前端的取法

Java代码

    @RequestMapping("/getHoman")
    public ModelAndView getHoman() {
        List> maps = jdbcTemplate.queryForList("SELECT * FROM t_struct where f_isdelete=0");
        String s = JSONArray.fromObject(maps).toString();
        ModelAndView modelAndView = new ModelAndView();

        modelAndView.getModel().put("organisation",s);
        modelAndView.setViewName("homan/structure");
        return modelAndView;
    }
前端页面取法

        function submitCustome() {
            alert(${organisation});
            var  list=${organisation};

            $.each(list, function(n, value){
               alert(value.F_KEY);
                alert(value);
            });
            $("#ff").css('display', 'none');
        }


你可能感兴趣的:(三大框架)