Spring Framework InterceptorRegistry - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework InterceptorRegistry class.

This code example shows how to use the following methods:addInterceptor
public class WebAppConfig extends RouterConfigurationSupport { 
 
    @Override 
    protected void addInterceptors(InterceptorRegistry registry) {
 
        registry.addInterceptor(new TeapotHandlerInterceptor());
    } 
 
    @Override 
    public List<String> listRouteFiles() {
 
        List<String> routeFiles = new ArrayList<String>();
        routeFiles.add("mappingroutes.conf");
 
        return routeFiles;
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
	// Configuration for the interceptor logging HandlerMethod information 
	// See ~.handlermethodinterceptor 
 
	@Override 
	protected void addInterceptors(InterceptorRegistry registry) { 
		registry.addInterceptor(new LoggingHandlerMethodInterceptor()); 
	} 
 
	// Configuration for custom @RequestMapping condition 
	// See ~.requestcondition package 
 
	@Override 
	@Bean 
	public RequestMappingHandlerMapping requestMappingHandlerMapping() { 
		RequestMappingHandlerMapping handlerMapping = new ExtendedRequestMappingHandlerMapping(); 
		handlerMapping.setOrder(0); 
		handlerMapping.setInterceptors(getInterceptors()); 
		return handlerMapping; 
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
{ 
	@Inject 
	private Environment environment; 
	 
	public void addInterceptors(InterceptorRegistry registry) { 
		registry.addInterceptor(new AuthenticationInterceptor()); 
	} 
	 
	public void addResourceHandlers(ResourceHandlerRegistry registry) { 
		registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); 
	} 
	 
	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { 
		converters.add(new MappingJacksonHttpMessageConverter()); 
	} 
	 
	public Validator getValidator() { 
		LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean(); 
		/*ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); 
		messageSource.setBasename("/WEB-INF/messages/validation"); 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
@Configuration 
@EnableWebMvc 
public class WebMvcConfig extends WebMvcConfigurerAdapter {
 
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new UserInterceptor(usersConnectionRepository));
	} 
 
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/signin");
		registry.addViewController("/signout");
	} 
 
	@Bean 
	public ViewResolver viewResolver() {
		InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
		viewResolver.setPrefix("/WEB-INF/views/");
		viewResolver.setSuffix(".jsp");
		return viewResolver;
	} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
@EnableWebMvc 
public class WebMvcConfig extends WebMvcConfigurerAdapter {
 
	@Override  
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new UserInterceptor(usersConnectionRepository));
	} 
	 
	@Override 
	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
		argumentResolvers.add(new SignedRequestArgumentResolver(environment.getProperty("facebook.appSecret")));
	} 
	 
	@Bean 
	public ViewResolver viewResolver(SpringTemplateEngine templateEngine) {
		ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
		viewResolver.setTemplateEngine(templateEngine);
		return viewResolver;
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
@Configuration 
@EnableWebMvc 
public class WebMvcConfig extends WebMvcConfigurerAdapter {
 
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new UserInterceptor(usersConnectionRepository));
	} 
 
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/signin");
		registry.addViewController("/signout");
	} 
 
	@Bean 
	public ViewResolver viewResolver(SpringTemplateEngine templateEngine) {
		ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
		viewResolver.setTemplateEngine(templateEngine);
		return viewResolver;
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
	protected void addFormatters(FormatterRegistry registry) { 
	} 
 
	@Override 
	public void addInterceptors(InterceptorRegistry registry) { 
		registry.addInterceptor(globalModelAttributesInterceptor); 
	} 
 
	@Override 
	protected void addResourceHandlers(ResourceHandlerRegistry registry) { 
 
	} 
 
	@Override 
	public void onApplicationEvent(ContextRefreshedEvent event) { 
 
	} 
 
	@Override 
	public RequestMappingHandlerMapping requestMappingHandlerMapping() { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
		registry.addResourceHandler("/Tutorial/**").addResourceLocations("/Tutorial/").setCachePeriod(RESOURCE_CACHE_PERIOD);
	} 
	 
	@Override 
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new RequestContextInterceptor());
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
    exceptionResolvers.add(new ExceptionHandlerExceptionResolver());
  } 
 
  @Override 
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new LoggingHandlerInterceptor());
    registry.addInterceptor(new TrailingSlashRedirectHandlerInterceptor());
  } 
 
  @Override 
  public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorParameter(false).favorPathExtension(true);
  } 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addInterceptor
@ComponentScan("org.springsource.samples.montyhall.controller") 
public class WebConfig extends WebMvcConfigurerAdapter {
 
	@Override 
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new CorsInterceptor());
	} 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework InterceptorRegistry Methods: