Java代码
@RequestMapping("/getHoman")
public ModelAndView getHoman() {
List<Map<String, Object>> 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');
}