前端之家收集整理的这篇文章主要介绍了
jQuery实现标签子元素的添加和赋值方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
deptList=null;
@RequestMapping(value = "/getDepts",method = {RequestMethod.GET})
public void getDepts(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("utf-8");
response.setContentType("text/json;charset=utf-8");
if (deptList == null){
deptList = deptService.findAllDepts();
}else {
String res=JSON.toJSONString(deptList);
response.getWriter().write(res);
}
}