翻阅古今
返回二进制图片案例:主要借助的是 HttpServletResponse这个对象,实现case如下@RequestMapping(value = {"/img/render"})@CrossOrigin(origins = "*")@ResponseBodypublic String execute(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse) {// img为图片的二进制流byte[] img = xxx;httpServletResponse.setContentType("image/png");OutputStream os = httpServletResponse.getOutputStream();os.write(img);os.flush();os.close();return "success";}返回图片的http地址返回base64格式的图片直接返回二进制的图片