aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets
diff options
context:
space:
mode:
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.java9
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java6
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java8
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java3
5 files changed, 28 insertions, 0 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 5403c9ab..12693797 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
@@ -92,6 +92,15 @@ public class ErrorPage extends HttpServlet {
String template = PdfAsHelper.getErrorRedirectTemplateSL();
template = template.replace("##ERROR_URL##",
errorURL);
+
+ String target = PdfAsHelper.getInvokeTarget(request, response);
+
+ if(target == null) {
+ target = "_self";
+ }
+
+ template = template.replace("##TARGET##", target);
+
if (e != null && WebConfiguration.isShowErrorDetails()) {
template = template.replace("##CAUSE##",
URLEncoder.encode(e.getMessage(), "UTF-8"));
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 f3c3fcca..fb633bd5 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
@@ -93,6 +93,9 @@ public class ExternSignServlet extends HttpServlet {
String invokeUrl = PdfAsParameterExtractor.getInvokeURL(request);
PdfAsHelper.setInvokeURL(request, response, invokeUrl);
+ String invokeTarget = PdfAsParameterExtractor.getInvokeTarget(request);
+ PdfAsHelper.setInvokeTarget(request, response, invokeTarget);
+
String pdfUrl = PdfAsParameterExtractor.getPdfUrl(request);
if (pdfUrl == null) {
@@ -244,6 +247,9 @@ public class ExternSignServlet extends HttpServlet {
String invokeUrl = PdfAsParameterExtractor.getInvokeURL(request);
PdfAsHelper.setInvokeURL(request, response, invokeUrl);
+ String invokeTarget = PdfAsParameterExtractor.getInvokeTarget(request);
+ PdfAsHelper.setInvokeTarget(request, response, invokeTarget);
+
String errorUrl = PdfAsParameterExtractor.getInvokeErrorURL(request);
PdfAsHelper.setErrorURL(request, response, errorUrl);
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 82bbc34f..1ee96602 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
@@ -104,6 +104,14 @@ public class ProvidePDFServlet extends HttpServlet {
throw new PdfAsException("No Signature data available");
}
+ String target = PdfAsHelper.getInvokeTarget(request, response);
+
+ if(target == null) {
+ target = "_self";
+ }
+
+ template = template.replace("##TARGET##", target);
+
template = template.replace("##PDFURL##",
URLEncoder.encode(PdfAsHelper.generatePdfURL(request, response),
"UTF-8"));
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java
index 3ff6eb09..40a8d590 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java
@@ -90,6 +90,8 @@ public class UIEntryPointServlet extends HttpServlet {
String invokeUrl = pdfAsRequest.getParameters().getInvokeURL();
PdfAsHelper.setInvokeURL(req, resp, invokeUrl);
+ // TODO: Generate attribute for Invoke Target
+
String errorUrl = pdfAsRequest.getParameters().getInvokeErrorURL();
PdfAsHelper.setErrorURL(req, resp, errorUrl);
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
index 83abdf2d..aa93f7c9 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
@@ -86,6 +86,9 @@ public class VerifyServlet extends HttpServlet {
String invokeUrl = PdfAsParameterExtractor.getInvokeURL(request);
PdfAsHelper.setInvokeURL(request, response, invokeUrl);
+ String invokeTarget = PdfAsParameterExtractor.getInvokeTarget(request);
+ PdfAsHelper.setInvokeTarget(request, response, invokeTarget);
+
String pdfUrl = PdfAsParameterExtractor.getPdfUrl(request);
if (pdfUrl == null) {