From 9c717316d28f90b3117df09b467f561fb84df62c Mon Sep 17 00:00:00 2001 From: rpiazzi Date: Tue, 14 Feb 2012 10:22:08 +0000 Subject: Added workaround: For external application pdf-as now gets directly from session and not from SignSessionInformation, which always is null git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@917 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java index dced4c9..60c5d41 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java @@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.pdfas.web.FormFields; import at.gv.egiz.pdfas.web.PDFContainer; +import at.gv.egiz.pdfas.web.servlets.SignServlet; import at.gv.egiz.pdfas.web.helper.SignServletHelper; import at.gv.egiz.pdfas.web.session.SessionAttributes; import at.gv.egiz.pdfas.web.session.SignSessionInformation; @@ -112,8 +113,10 @@ public class ProvidePDFServlet extends HttpServlet { SignServletHelper.disableBrowserCacheForResponse(response); response.setContentType("application/pdf"); response.setContentLength(pdf.length); - SignSessionInformation si = (SignSessionInformation)session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION); - response.setHeader("Content-disposition", "attachment; filename=\""+si.filename+"\""); + //SignSessionInformation si = (SignSessionInformation)session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION); + String filename = (String)session.getAttribute(SignServlet.SUBMITFORM_FILENAME_KEY); + + response.setHeader("Content-disposition", "attachment; filename=\""+filename+"\""); InputStream is = new ByteArrayInputStream(pdf); final int bufferSize = 1024; -- cgit v1.2.3