From 9ffb457a5745de09be04aad98761b2d179892f11 Mon Sep 17 00:00:00 2001 From: tknall Date: Sun, 16 Sep 2007 02:33:14 +0000 Subject: minor bug fixed (query url for external webapp was not correctly built) git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@212 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../pdfas/framework/config/SettingsHelper.java | 1 + .../wag/egov/egiz/web/servlets/SignServlet.java | 23 ++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java b/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java index 6f67d1d..abe4378 100644 --- a/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java @@ -17,6 +17,7 @@ public final class SettingsHelper public static VerificationFilterParameters readVerificationFilterParametersFromSettings() throws SettingsException { boolean binaryOnly = getFlag("binary_only"); + // TODO: tknall: typo should be fixed (including entry within config.properties) boolean assumeOnlySB = getFlag("assume_only_signauture_blocks"); boolean checkOld = getFlag("check_old_textual_sigs"); diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java index 04971c6..13e6703 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java @@ -189,16 +189,23 @@ public class SignServlet extends HttpServlet String sig_pos_y = (String) request.getParameter(FormFields.FIELD_SIGPOS_Y); String sig_pos_p = (String) request.getParameter(FormFields.FIELD_SIGPOS_P); - try - { - pos = new TablePos("y:" + sig_pos_y + ";p:" + sig_pos_p); - } - catch (PDFDocumentException e) - { - log.warn("Uanable to create signature position object: " + e.getMessage()); + // added by tknall + if (sig_pos_y != null && sig_pos_p != null) { + try + { + pos = new TablePos("y:" + sig_pos_y + ";p:" + sig_pos_p); + } + catch (PDFDocumentException e) + { + log.warn("Unable to create signature position object: " + e.getMessage()); + } + } else { + log.debug("No signature position provided."); } - String query = pdf_url + "&" + FormFields.FIELD_PDF_ID + "=" + pdf_id; + // fixed by tknall: if we already have parameters "&" must be used instead of "?" + String paramSeparator = (pdf_url.indexOf("?") != -1) ? "&" : "?"; + String query = pdf_url + paramSeparator + FormFields.FIELD_PDF_ID + "=" + pdf_id; // wprinz: rem: this allocation is useless // byte[] extern_pdf = new byte[Integer.parseInt(pdf_length)]; -- cgit v1.2.3