diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-09-16 21:45:10 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-09-16 21:45:10 +0000 |
commit | 6f8f9f801c56e1c1b743db514ff22ce75157a71b (patch) | |
tree | 6daf1c9cbaf516f5d685ffbe1a49562219e36dba /src/main | |
parent | 9ffb457a5745de09be04aad98761b2d179892f11 (diff) | |
download | pdf-as-3-6f8f9f801c56e1c1b743db514ff22ce75157a71b.tar.gz pdf-as-3-6f8f9f801c56e1c1b743db514ff22ce75157a71b.tar.bz2 pdf-as-3-6f8f9f801c56e1c1b743db514ff22ce75157a71b.zip |
fixed bug concerning compilation of callback url for external application
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@213 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java b/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java index 9826500..0c85201 100644 --- a/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java @@ -212,11 +212,24 @@ public class SignServletHelper String pdf_id = String.valueOf(si.exappinf.pdf_id);
String session_id = si.exappinf.session_id;
+ log.debug("External application has to be notified. Building url from callback url \"" + invoke_url + "\".");
+
// build URL
int ind = invoke_url.indexOf("?");
- String query = invoke_url.substring(0, ind) + ";jsessionid=" + session_id + invoke_url.substring(ind) + "&" + FormFields.FIELD_PDF_URL + "=" + providePDFServlet + "&" + FormFields.FIELD_PDF_ID
- + "=" + pdf_id + "&" + FormFields.FIELD_FILE_LENGTH + "=" + signed_pdf.length;
+
+ // fixed by tknall: must not presume that invoke_url contains "?"
+ String sep = "&";
+ if (ind == -1) {
+ ind = invoke_url.length();
+ sep = "?";
+ }
+
+ String query = invoke_url.substring(0, ind) + ";jsessionid=" + session_id + invoke_url.substring(ind)
+ + sep + FormFields.FIELD_PDF_URL + "=" + providePDFServlet + "&" + FormFields.FIELD_PDF_ID
+ + "=" + pdf_id + "&" + FormFields.FIELD_FILE_LENGTH + "=" + signed_pdf.length;
+ log.debug("Notifying external application by redirecting to \"" + query + "\".");
+
response.sendRedirect(query);
}
|