Esto es lo que ¿Estás buscando?
ConfigClass extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new HandlerInterceptor() {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.out.println("Request Url: " + request.getRequestURL().toString()+ "?" + request.getQueryString());
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
// TODO Auto-generated method stub
}
});
super.addInterceptors(registry);
}
}
En realidad, la respuesta de @ashario anterior (http://stackoverflow.com/a/23468496/35274) muestra que se puede hacer. – Philippe