这是我动态生成PDF的代码
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment; filename=report.pdf");
Api apix = new Api(new ApiRequest(2));
apix.reporter.makeReport(response.getOutputStream());
}
它有效,但是,我得到了这个对话框:
而不是“另存为”对话框
可能出错?