aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-09-26 11:23:56 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-09-26 11:23:56 +0200
commit023d1b5d7046b6a3062e90a4628f09a50a876f1b (patch)
tree5c30a577a8ceda48476325e2796192ed2ab26944 /pdf-as-web
parentea6c601655c4f4b5b14788cec05e41a6cf5c9e30 (diff)
downloadpdf-as-4-023d1b5d7046b6a3062e90a4628f09a50a876f1b.tar.gz
pdf-as-4-023d1b5d7046b6a3062e90a4628f09a50a876f1b.tar.bz2
pdf-as-4-023d1b5d7046b6a3062e90a4628f09a50a876f1b.zip
added filename parameter to overwrite default pdf filename
Diffstat (limited to 'pdf-as-web')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java6
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java6
2 files changed, 12 insertions, 0 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
index 017eabb2..c8f35f3c 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
@@ -61,6 +61,7 @@ public class PdfAsParameterExtractor {
public static final String PARAM_SIG_POS_R = "sig-pos-r";
public static final String PARAM_SIG_POS_F = "sig-pos-f";
public static final String PARAM_SIG_IDX = "sig-idx";
+ public static final String PARAM_FILENAME = "filename";
public static String getConnector(HttpServletRequest request) {
String connector = (String)request.getAttribute(PARAM_CONNECTOR);
@@ -75,6 +76,11 @@ public class PdfAsParameterExtractor {
return transactionId;
}
+ public static String getFilename(HttpServletRequest request) {
+ String filename = (String)request.getAttribute(PARAM_FILENAME);
+ return filename;
+ }
+
public static String getInvokeURL(HttpServletRequest request) {
return (String)request.getAttribute(PARAM_INVOKE_URL);
}
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
index 121fbc88..ce19f803 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
@@ -261,6 +261,12 @@ public class ExternSignServlet extends HttpServlet {
String locale = PdfAsParameterExtractor.getLocale(request);
PdfAsHelper.setLocale(request, response, locale);
+ String filename = PdfAsParameterExtractor.getFilename(request);
+ if(filename != null) {
+ logger.debug("Setting Filename in session: " + filename);
+ PdfAsHelper.setPDFFileName(request, filename);
+ }
+
if(pdfData == null) {
throw new PdfAsException("No Signature data available");
}