我想知道是否有办法在流式传输或使用HttpServletResponse写入输出流后显示浏览器的打印对话框,如下面的代码段所示:
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.reset();
response.setContentType("application/pdf");
response.setHeader("Content-disposition", "attachment; filename=\"testFile.pdf\"");
OutputStream output = response.getOutputStream();
output.write(finalData);
output.flush();
output.close();