From 20470a3c7cdc57d782bdeaafcbcb0bf86c4e71bb Mon Sep 17 00:00:00 2001 From: tkellner Date: Tue, 16 Oct 2012 14:57:13 +0000 Subject: Set a compact P3P Policy header to let IE accept cookies git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1149 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/webapp/MoccaParameterBean.java | 2 ++ .../src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java | 3 +++ .../src/main/java/at/gv/egiz/bku/online/webapp/UIServlet.java | 7 +++++++ .../main/java/at/gv/egiz/bku/online/webapp/WebRequestHandler.java | 4 ++++ 4 files changed, 16 insertions(+) (limited to 'BKUOnline/src/main/java') diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/MoccaParameterBean.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/MoccaParameterBean.java index e6a79e97..74d6515d 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/MoccaParameterBean.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/MoccaParameterBean.java @@ -67,6 +67,8 @@ public class MoccaParameterBean { public static final String PARAM_LOCALE = "locale"; public static final Pattern PATTERN_LOCALE = Pattern.compile("[a-zA-Z][a-zA-Z](_[a-zA-Z][a-zA-Z]){0,2}"); + public static final String P3P_POLICY = "CP=\"NON DSP COR CUR ADM DEV TAI PSA PSD OUR DEL IND UNI COM NAV INT CNT STA\""; + private Charset charset = Charset.forName("ISO-8859-1"); private HTTPBindingProcessor bindingProcessor; 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 4eb7ea66..db59ad5d 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 @@ -87,6 +87,9 @@ public class ResultServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { + // Set P3P Policy Header + resp.addHeader("P3P", MoccaParameterBean.P3P_POLICY); + BindingProcessorManager bindingProcessorManager = (BindingProcessorManager) getServletContext() .getAttribute("bindingProcessorManager"); if (bindingProcessorManager == null) { diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/UIServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/UIServlet.java index 516f75ea..8d5eacd9 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/UIServlet.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/UIServlet.java @@ -70,6 +70,9 @@ public class UIServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + // Set P3P Policy Header + resp.addHeader("P3P", MoccaParameterBean.P3P_POLICY); + BindingProcessorManager bindingProcessorManager = (BindingProcessorManager) getServletContext() .getAttribute("bindingProcessorManager"); if (bindingProcessorManager == null) { @@ -110,6 +113,10 @@ public class UIServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + // Set P3P Policy Header + resp.addHeader("P3P", MoccaParameterBean.P3P_POLICY); + super.doPost(req, resp); } 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 8c8d27b2..72443b27 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 @@ -56,6 +56,10 @@ public class WebRequestHandler extends HttpServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { + + // Set P3P Policy Header + resp.addHeader("P3P", MoccaParameterBean.P3P_POLICY); + BindingProcessorManager bindingProcessorManager = (BindingProcessorManager) getServletContext() .getAttribute("bindingProcessorManager"); if (bindingProcessorManager == null) { -- cgit v1.2.3