HTML: <div > <img src= "${ctx}/common/file/getImgs?name=" style="width: 300px; height: 300px;" alt="logo"></div> Java: @RequestMapping("getImgs") public void getImg2(HttpServletRequest request, HttpServletResponse response,String name) throws IOException { if(null !=name && !("")){ FileInputStream fis = null; OutputStream os = null; try { //公共服务器目录地址 fis = new FileInputStream("\\\\W01DFS0185\\LDMS\\training_video_docs\\"+name); os = (); int count = 0; byte[] buffer = new byte[1024 * 8]; while ((count = (buffer)) != -1) { (buffer, 0, count); (); } } catch (Exception e) { (); } finally { try { (); (); } catch (IOException e) { (); } } } }