From 06a677a459cbcef5167c866145f09a2349e426a5 Mon Sep 17 00:00:00 2001 From: rpiazzi Date: Fri, 7 Oct 2011 15:54:44 +0000 Subject: Added exeption handling for type at.gv.egiz.pdfas.exceptions.external.ExternalErrorException. Set session attribute ERROR_WITHIN_IFRAME to false to react to the out-redirection from iframe of online or mobile CCS. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@858 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java index 588a969..1936e41 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java @@ -52,6 +52,8 @@ import at.gv.egiz.pdfas.api.PdfAs; import at.gv.egiz.pdfas.api.commons.Constants; import at.gv.egiz.pdfas.api.commons.SignatureInformation; import at.gv.egiz.pdfas.api.exceptions.PdfAsException; +import at.gv.egiz.pdfas.exceptions.external.ExternalErrorException; +import at.gv.egiz.pdfas.exceptions.web.SessionExpiredException; import at.gv.egiz.pdfas.api.internal.LocalBKUParams; import at.gv.egiz.pdfas.api.internal.PdfAsInternal; import at.gv.egiz.pdfas.api.verify.VerifyResult; @@ -65,6 +67,7 @@ import at.gv.egiz.pdfas.web.helper.SigningTimeHelper; import at.gv.egiz.pdfas.web.session.SessionAttributes; import at.gv.egiz.pdfas.web.session.SignSessionInformation; import at.gv.egiz.pdfas.web.session.VerifySessionInformation; +import at.gv.egiz.pdfas.web.servlets.SignServlet; import at.knowcenter.wag.egov.egiz.exceptions.ConnectorException; import at.knowcenter.wag.egov.egiz.exceptions.SignatureException; @@ -155,6 +158,14 @@ public class DataURLServlet extends HttpServlet } } + catch (ExternalErrorException f) { + log.error(f.getMessage(), f); + HttpSession session = request.getSession(true); + session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, "false"); + log.debug("Attribute ERROR_WITHIN_IFRAME: "+session.getAttribute(SignServlet.ERROR_WITHIN_IFRAME)); + SignServlet.prepareDispatchToErrorPage(f, request); + dispatch(request, response, "/jsp/error.jsp"); + } catch (PdfAsException e) { log.error(e.getMessage(), e); -- cgit v1.2.3