SHARE
TWEET

Untitled

a guest Nov 19th, 2014 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             try {
  2.                 Path path = Paths.get("ARQUIVO");
  3.                 byte[] data = Files.readAllBytes(path);
  4.  
  5.                 HttpServletResponse httpServletResponse = response.raw();
  6.  
  7.                 httpServletResponse.setContentType("application/pdf");
  8.                 httpServletResponse.addHeader("Content-Disposition", "inline; filename=mypdf.pdf");
  9.                 httpServletResponse.getOutputStream().write(data);
  10.                 httpServletResponse.getOutputStream().close();
  11.             } catch (IOException e) {
  12.                 e.printStackTrace();
  13.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top