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 --- .../wag/egov/egiz/web/servlets/SignServlet.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/knowcenter') 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