springmvc 怎么响应json数据

springmvc 怎么响应json数据
@Controller
@RequestMapping("/items")

class ItemsController{
  @RequestMapping("/queryItems")
  queryItems(request, response){
    response.setCharacterEncoding("utf-8");
    response.setContentType("application/json;charset=utf-8");
    response.getWriter().write("json串");
  }
}

原文地址:https://www.cnblogs.com/gongchengshixiaobai/p/8024136.html