summaryrefslogtreecommitdiff
path: root/BKUOnline
diff options
context:
space:
mode:
authorwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-18 10:34:26 +0000
committerwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-18 10:34:26 +0000
commitcd8bc974aacc45f1f8ee4aa51f03e2f647dc8bc4 (patch)
treec69c445b4c09e0b390f9c3b452a14c5cd80cd825 /BKUOnline
parent77a19e106e4128c21dd2d1270fdc8d930e415247 (diff)
downloadmocca-cd8bc974aacc45f1f8ee4aa51f03e2f647dc8bc4.tar.gz
mocca-cd8bc974aacc45f1f8ee4aa51f03e2f647dc8bc4.tar.bz2
mocca-cd8bc974aacc45f1f8ee4aa51f03e2f647dc8bc4.zip
fixed bug #368
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@254 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUOnline')
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java9
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java9
2 files changed, 17 insertions, 1 deletions
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
index 12166a5a..781e0832 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
@@ -50,6 +50,7 @@ public class BKURequestHandler extends SpringBKUServlet {
private static final long serialVersionUID = 1L;
public final static String REDIRECT_URL = "appletPage.jsp";
+ public final static String REDIRECT_URL_SESSION_ATTRIBUTE="redirectUrl";
protected Log log = LogFactory.getLog(BKURequestHandler.class);
@@ -170,7 +171,13 @@ public class BKURequestHandler extends SpringBKUServlet {
log.debug("Using locale " + locale);
session.setAttribute("locale", locale.toString());
}
-
+
+ // handle server side redirect url after processing
+ String redirectUrl = bindingProcessor.getRedirectURL();
+ if ( redirectUrl != null) {
+ log.debug("Got redirect URL "+redirectUrl+". Deferring browser redirect.");
+ session.setAttribute(REDIRECT_URL_SESSION_ATTRIBUTE, redirectUrl);
+ }
// TODO error if no dispatcher found
RequestDispatcher dispatcher = getServletContext().getNamedDispatcher(
BKU_APPLET_JSP);
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
index 9e69099d..36d41629 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
@@ -100,8 +100,17 @@ public class ResultServlet extends SpringBKUServlet {
return;
}
+ String redirectUrl = (String) session.getAttribute(BKURequestHandler.REDIRECT_URL_SESSION_ATTRIBUTE);
+ if (redirectUrl != null) {
+ log.debug("Executing deferred browser redirect to: "+redirectUrl);
+ resp.sendRedirect(redirectUrl);
+ session.invalidate();
+ return;
+ }
+
if (bp.getRedirectURL() != null) {
resp.sendRedirect(bp.getRedirectURL());
+ session.invalidate();
return;
}
resp.setStatus(bp.getResponseCode());