diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-08-19 11:45:45 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-08-19 11:45:45 +0200 |
commit | 80686cc60dc0bccb7a42fddefefcf13dcabdd80a (patch) | |
tree | 98810b82688b0b4670351bdcfd0c3f145dd44c87 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets | |
parent | e1b810ee9221f6247c575c669bff2ba98552c65e (diff) | |
download | pdf-as-4-80686cc60dc0bccb7a42fddefefcf13dcabdd80a.tar.gz pdf-as-4-80686cc60dc0bccb7a42fddefefcf13dcabdd80a.tar.bz2 pdf-as-4-80686cc60dc0bccb7a42fddefefcf13dcabdd80a.zip |
Fixed #18, Get Parameters in external urls are not discarded
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ErrorPage.java | 6 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ErrorPage.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ErrorPage.java index 12693797..8e59ff1c 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ErrorPage.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ErrorPage.java @@ -24,6 +24,7 @@ package at.gv.egiz.pdfas.web.servlets; import java.io.IOException; +import java.net.URL; import java.net.URLEncoder; import javax.servlet.ServletException; @@ -37,6 +38,7 @@ import org.slf4j.LoggerFactory; import at.gv.egiz.pdfas.web.config.WebConfiguration; import at.gv.egiz.pdfas.web.helper.HTMLFormater; import at.gv.egiz.pdfas.web.helper.PdfAsHelper; +import at.gv.egiz.pdfas.web.helper.UrlParameterExtractor; /** * Servlet implementation class ErrorPage @@ -93,6 +95,10 @@ public class ErrorPage extends HttpServlet { template = template.replace("##ERROR_URL##", errorURL); + URL url = new URL(errorURL); + String extraParams = UrlParameterExtractor.buildParameterFormString(url); + template = template.replace("##ADD_PARAMS##", extraParams); + String target = PdfAsHelper.getInvokeTarget(request, response); if(target == null) { 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 1ee96602..7909e926 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 @@ -24,6 +24,7 @@ package at.gv.egiz.pdfas.web.servlets; import java.io.IOException; +import java.net.URL; import java.net.URLEncoder; import javax.servlet.ServletException; @@ -37,6 +38,7 @@ import org.slf4j.LoggerFactory; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.web.config.WebConfiguration; import at.gv.egiz.pdfas.web.helper.PdfAsHelper; +import at.gv.egiz.pdfas.web.helper.UrlParameterExtractor; /** * Servlet implementation class ProvidePDF @@ -95,7 +97,11 @@ public class ProvidePDFServlet extends HttpServlet { // Redirect Browser String template = PdfAsHelper.getInvokeRedirectTemplateSL(); template = template.replace("##INVOKE_URL##", invokeURL); - + + URL url = new URL(invokeURL); + String extraParams = UrlParameterExtractor.buildParameterFormString(url); + template = template.replace("##ADD_PARAMS##", extraParams); + byte[] signedData = PdfAsHelper.getSignedPdf(request, response); if (signedData != null) { template = template.replace("##PDFLENGTH##", |