From 2eb8bc420b4f239bed907d29c547737a56a22c8d Mon Sep 17 00:00:00 2001 From: tkellner Date: Thu, 14 Nov 2013 11:20:35 +0000 Subject: Make ui redirect url configurable git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1218 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/webapp/WebRequestHandler.java | 18 +++++++++++++----- BKUOnline/src/main/webapp/WEB-INF/web.xml | 7 +++++++ 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'BKUOnline/src') diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/WebRequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/WebRequestHandler.java index 53175b3c..6accc5a1 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/WebRequestHandler.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/WebRequestHandler.java @@ -21,8 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - - package at.gv.egiz.bku.online.webapp; import java.io.ByteArrayInputStream; @@ -51,9 +49,20 @@ import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage; public class WebRequestHandler extends HttpServlet { private static final long serialVersionUID = 1L; - + private final Logger log = LoggerFactory.getLogger(WebRequestHandler.class); + private String uiRedirectUrl = "ui"; + + @Override + public void init() throws ServletException { + String url = getServletConfig().getInitParameter("uiRedirectUrl"); + if (url != null) { + uiRedirectUrl = url; + log.info("Init uiRedirectUrl to: {}.", uiRedirectUrl); + } + } + @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { @@ -138,7 +147,7 @@ public class WebRequestHandler extends HttpServlet { bindingProcessorManager.process(id, bindingProcessor); log.debug("Sending redirect to user interface."); - resp.sendRedirect(resp.encodeRedirectURL("ui")); + resp.sendRedirect(resp.encodeRedirectURL(uiRedirectUrl)); } @@ -147,5 +156,4 @@ public class WebRequestHandler extends HttpServlet { throws ServletException, java.io.IOException { doPost(req, resp); } - } diff --git a/BKUOnline/src/main/webapp/WEB-INF/web.xml b/BKUOnline/src/main/webapp/WEB-INF/web.xml index a7abe389..5033cc5e 100644 --- a/BKUOnline/src/main/webapp/WEB-INF/web.xml +++ b/BKUOnline/src/main/webapp/WEB-INF/web.xml @@ -58,6 +58,13 @@ protocol HTTP + + + uiRedirectUrl + ui +