This is my code to generate a PDF on the fly
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());
}
It works, but, I get this dialog:
instead of a 'Save as' dialog
what could be wrong?