Spring interceptors
What sets an interceptor apart from a filter is position. An interceptor runs inside the DispatcherServlet, after handler mapping has decided which controller handles the request. So an interceptor already knows which handler is about to run. It intercepts that execution at three points (before the controller, after the controller, after view rendering), and at the first point it can block the request entirely. The three hooks HandlerInterceptor provides three methods, each intercepting a different moment. ...