From dfc8df42f59ab8fa5d484bd47f91f7b669d020d3 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 1 Jun 2015 19:09:42 -0400 Subject: [PATCH] moved server configuration injection to pre-request --- .../openid/connect/web/ServerConfigInterceptor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ServerConfigInterceptor.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ServerConfigInterceptor.java index 0cf594a1b..ad833f408 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ServerConfigInterceptor.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ServerConfigInterceptor.java @@ -29,7 +29,8 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; /** * - * Injects the server configuration bean into the Model context, if it exists. Allows JSPs and the like to call "config.logoUrl" among others. + * Injects the server configuration bean into the request context. + * This allows JSPs and the like to call "config.logoUrl" among others. * * @author jricher * @@ -40,10 +41,9 @@ public class ServerConfigInterceptor extends HandlerInterceptorAdapter { private ConfigurationPropertiesBean config; @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - if (modelAndView != null) { // skip checking at all if we have no model and view to hand the config to - modelAndView.addObject("config", config); - } + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + request.setAttribute("config", config); + return true; } - + }