@Test public void preHandleCustomNormal() throws Exception { SitePreferenceHandler handler = new SitePreferenceHandler() { public SitePreference handleSitePreference(HttpServletRequest request, HttpServletResponse response) { request.setAttribute("currentSitePreference", SitePreference.NORMAL); return SitePreference.NORMAL; } }; SitePreferenceHandlerInterceptor interceptor = new SitePreferenceHandlerInterceptor(handler); boolean result = interceptor.preHandle(request, response, null); assertEquals(SitePreference.NORMAL, request.getAttribute("currentSitePreference")); assertTrue(result); }
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { sitePreferenceHandler.handleSitePreference(request, response); return true; }
SitePreferenceHandlerInterceptor extends HandlerInterceptorAdapter { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { sitePreferenceHandler.handleSitePreference(request, response); return true; } }
SitePreferenceHandlerInterceptor extends HandlerInterceptorAdapter { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { sitePreferenceHandler.handleSitePreference(request, response); return true; } SitePreferenceHandlerInterceptor();  SitePreferenceHandlerInterceptor(SitePreferenceHandler sitePreferenceHandler); }
SitePreferenceHandlerInterceptor extends HandlerInterceptorAdapter { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { sitePreferenceHandler.handleSitePreference(request, response); return true; } SitePreferenceHandlerInterceptor();  SitePreferenceHandlerInterceptor(SitePreferenceHandler sitePreferenceHandler); boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler); }
SitePreferenceHandlerInterceptor extends HandlerInterceptorAdapter { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { sitePreferenceHandler.handleSitePreference(request, response); return true; } SitePreferenceHandlerInterceptor();  SitePreferenceHandlerInterceptor(SitePreferenceHandler sitePreferenceHandler); boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler);  }