List<Role> roles=departmentManager.selectOneSchoolAllRole(departId); String jsonstr = JSON.toJSONString(roles); //阿里的jar包 String com. alibaba. fastjson. JSON.toJSONString( Object object) response.getWriter().write(jsonstr);