Java tutorial
package com.orange.clara.cloud.servicedbdumper.config; import com.orange.clara.cloud.servicedbdumper.interceptor.AddAdminUrlsInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Copyright (C) 2015 Orange * <p> * This software is distributed under the terms and conditions of the 'Apache-2.0' * license which can be found in the file 'LICENSE' in this package distribution * or at 'https://opensource.org/licenses/Apache-2.0'. * <p> * Author: Arthur Halet * Date: 10/12/2015 */ @Configuration public class WebApplicationConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(this.addAdminUrlsInterceptor()).addPathPatterns("/admin/**") .addPathPatterns(Routes.MANAGE_ROOT + "/**"); } @Bean public AddAdminUrlsInterceptor addAdminUrlsInterceptor() { return new AddAdminUrlsInterceptor(); } }