aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/jsp/error.jsp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/jsp/error.jsp')
-rw-r--r--src/main/webapp/jsp/error.jsp44
1 files changed, 40 insertions, 4 deletions
diff --git a/src/main/webapp/jsp/error.jsp b/src/main/webapp/jsp/error.jsp
index 2183a62..4bd49a4 100644
--- a/src/main/webapp/jsp/error.jsp
+++ b/src/main/webapp/jsp/error.jsp
@@ -2,6 +2,10 @@
<%@ page import="at.knowcenter.wag.egov.egiz.web.LocalRequestHelper" %>
<%@ page import="at.knowcenter.wag.egov.egiz.web.servlets.SignServlet" %>
<%@ page import="at.knowcenter.wag.egov.egiz.exceptions.*" %>
+<%@ page import="at.gv.egiz.pdfas.web.SignSessionInformation" %>
+<%@ page import="at.knowcenter.wag.egov.egiz.web.SessionAttributes" %>
+<%@ page import="org.apache.commons.httpclient.util.EncodingUtil" %>
+<%@ page import="org.apache.commons.httpclient.NameValuePair" %>
<%@ page import="java.io.*" %>
<%@ include file="language.jsp" %>
@@ -22,9 +26,39 @@
SignServlet.prepareDispatchToErrorPage(pe, request);
}
- String error = (request.getAttribute("error") == null ? "" : request.getAttribute("error").toString());
- String cause = (request.getAttribute("cause") == null ? "" : request.getAttribute("cause").toString());
+ String error = request.getParameter("error");
+ boolean paramInvok = false;
+ if (error == null) {
+ error = (request.getAttribute("error") == null ? "" : request.getAttribute("error").toString());
+ } else {
+ paramInvok = true;
+ }
+ String cause = request.getParameter("cause");
+ if (cause == null) {
+ cause = (request.getAttribute("cause") == null ? "" : request.getAttribute("cause").toString());
+ } else {
+ paramInvok = true;
+ }
boolean rb = Boolean.TRUE.equals((Boolean) request.getAttribute("resourcebundle"));
+ SignSessionInformation si = (SignSessionInformation) session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION);
+
+ boolean isExternalInvocation = (si != null && si.exappinf != null);
+
+ if (isExternalInvocation) {
+ String urlParams = EncodingUtil.formUrlEncode(new NameValuePair[] { new NameValuePair("error", error), new NameValuePair("cause", cause) }, "ISO8859_1");
+ if (si.exappinf.invoke_error_url == null) {
+ // prevent circular redirect
+ si.exappinf = null;
+ String redirectUrl = response.encodeRedirectURL(request.getContextPath() + "/jsp/error.jsp" + "?" + urlParams);
+ session.setAttribute(SessionAttributes.PARENT_WEBAPP_REDIRECT_URL, redirectUrl);
+ } else {
+ String errorUrl = si.exappinf.invoke_error_url + "?" + urlParams;
+ session.setAttribute(SessionAttributes.PARENT_WEBAPP_REDIRECT_URL, errorUrl);
+ }
+ String redirectHelper = response.encodeRedirectURL(request.getContextPath() + "/jsp/redirect_to_parent.jsp");
+ response.sendRedirect(redirectHelper);
+ }
+
%>
<body>
@@ -40,8 +74,10 @@
<fmt:message key="<%= cause %>"/>
<% } else { out.write(cause); } %>
</strong></div>
- <div class="pdfasverticalspace"></div>
- <a href="<%=LocalRequestHelper.getLocalContextAddress(request,response)%>/"><fmt:message key="common.back"/></a>
+ <% if (!isExternalInvocation && !paramInvok) { %>
+ <div class="pdfasverticalspace"></div>
+ <a href="<%=LocalRequestHelper.getLocalContextAddress(request,response)%>/"><fmt:message key="common.back"/></a>
+ <% } // end if %>
<pre style="display:none">
<%
if (pe != null) {