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串");
  }
}

上一篇:为什么需要Bundler


下一篇:PHP用PDO