summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-18 10:48:48 +0000
committerwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-18 10:48:48 +0000
commit6872541d0e5535327530592aeadad7b6275ade1c (patch)
tree399977166c5ffb7a70707a79d3adbe69d90fe788
parentcd8bc974aacc45f1f8ee4aa51f03e2f647dc8bc4 (diff)
downloadmocca-6872541d0e5535327530592aeadad7b6275ade1c.tar.gz
mocca-6872541d0e5535327530592aeadad7b6275ade1c.tar.bz2
mocca-6872541d0e5535327530592aeadad7b6275ade1c.zip
now reading result from bindingprocessor when redirecting
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@255 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java30
1 files changed, 16 insertions, 14 deletions
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 36d41629..f271dfc9 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
@@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
import at.gv.egiz.bku.binding.HTTPBindingProcessor;
import at.gv.egiz.bku.binding.HttpUtil;
import at.gv.egiz.bku.binding.IdFactory;
-import at.gv.egiz.bku.conf.Configurator;
+import at.gv.egiz.bku.utils.NullOutputStream;
/**
* Delivers the result to the browser
@@ -99,18 +99,20 @@ public class ResultServlet extends SpringBKUServlet {
resp.sendRedirect(expiredPage);
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;
+ String redirectUrl = (String) session
+ .getAttribute(BKURequestHandler.REDIRECT_URL_SESSION_ATTRIBUTE);
+ if (redirectUrl == null) {
+ redirectUrl = bp.getRedirectURL();
}
-
- if (bp.getRedirectURL() != null) {
- resp.sendRedirect(bp.getRedirectURL());
- session.invalidate();
+ if (redirectUrl != null) {
+ try {
+ bp.writeResultTo(new NullOutputStream(), encoding);
+ getBindingProcessorManager().removeBindingProcessor(bp.getId());
+ } finally {
+ log.debug("Executing deferred browser redirect to: " + redirectUrl);
+ resp.sendRedirect(redirectUrl);
+ session.invalidate();
+ }
return;
}
resp.setStatus(bp.getResponseCode());
@@ -118,8 +120,8 @@ public class ResultServlet extends SpringBKUServlet {
resp.setHeader("Pragma", "no-cache"); // HTTP 1.0
resp.setDateHeader("Expires", 0);
if (configurator.getProperty(USER_AGENT_PROPERTY_KEY) != null) {
- resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT, configurator.getProperty(
- USER_AGENT_PROPERTY_KEY));
+ resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT, configurator
+ .getProperty(USER_AGENT_PROPERTY_KEY));
} else {
resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT,
"citizen-card-environment/1.2 MOCCA Unknown");