Java Apache httpclient interceptor for Spring MVC Configuration

import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.springframework.web.servlet.HandlerInterceptor;import org.springframework.web.servlet.ModelAndView;import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;public class SecurityWebInterceptor extends HandlerInterceptorAdapter {@Overridepublic boolean preHandle(HttpServletRequest requestServlet, HttpServletResponse responseServlet, Object handler) throws Exception{System.out.println("MINIMAL: INTERCEPTOR PREHANDLE CALLED");return true;}@Overridepublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception{System.out.println("MINIMAL: INTERCEPTOR POSTHANDLE CALLED");}@Overridepublic void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception exception) throws Exception{System.out.println("MINIMAL: INTERCEPTOR AFTERCOMPLETION CALLED");}}
public class WebConfiguration implements WebMvcConfigurer {

...
@Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new SecurityWebInterceptor()); } ...}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store