Spring Framework WebMvcConfigurerAdapter - 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 WebMvcConfigurerAdapter class.

This code example shows how to use the following methods:
	} 
 
 
	@Configuration 
	@EnableWebMvc 
	static class WebConfig extends WebMvcConfigurerAdapter { 
 
		@Bean 
		public MyController myController() { 
			return new MyController(); 
		} 
 
		@Bean 
		public HandlerMappingConfigurer myHandlerMappingConfigurer() { 
			return new HandlerMappingConfigurer(); 
		} 
 
		@Override 
		public void configureViewResolvers(ViewResolverRegistry registry) { 
			registry.jsp("", ""); 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * @author Rob Winch 
 * @since 3.2 
 */ 
@Configuration 
@EnableWebSecurity 
public class WebMvcSecurityConfiguration extends WebMvcConfigurerAdapter {
 
    @Override 
    @SuppressWarnings("deprecation") 
    public void addArgumentResolvers( 
            List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new AuthenticationPrincipalArgumentResolver());
        argumentResolvers.add(new org.springframework.security.web.bind.support.AuthenticationPrincipalArgumentResolver());
    } 
 
    @Bean 
    public RequestDataValueProcessor requestDataValueProcessor() {
        return new CsrfRequestDataValueProcessor(); 
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.thymeleaf.spring4.view.ThymeleafViewResolver; 
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; 
 
@EnableWebMvc 
@ComponentScan("org.springframework.security.samples.mvc") 
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
 
    @Autowired 
    private FormattingConversionService mvcConversionService;
 
    @Override 
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login").setViewName("login");
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    } 
 
    @Override 
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/resources/").setCachePeriod(31556926);
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
 
@Configuration 
@EnableWebMvc 
public class WebMvcConfig extends WebMvcConfigurerAdapter {
 
	@Bean 
	public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
		return new PropertySourcesPlaceholderConfigurer();
	} 
 
	@Bean 
	public ContentNegotiatingViewResolver contentViewResolver() throws Exception {
		ContentNegotiationManagerFactoryBean contentNegotiationManager = new ContentNegotiationManagerFactoryBean();
		contentNegotiationManager.addMediaType("json", MediaType.APPLICATION_JSON);
 
		InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
		viewResolver.setPrefix("/WEB-INF/jsp/");
		viewResolver.setSuffix(".jsp");
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package com.findwise.hydra.admin.rest; 
 
import org.springframework.context.annotation.Configuration; 
import org.springframework.web.servlet.config.annotation.EnableWebMvc; 
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
@Configuration 
@EnableWebMvc 
public class WebConfig extends WebMvcConfigurerAdapter {
 
	@Override 
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/gui/**").addResourceLocations("/WEB-INF/static/");
                  registry.addResourceHandler("/webjars/**").addResourceLocations("/webjars/");
		super.addResourceHandlers(registry);
	} 
} 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 *  
 */ 
@Configuration 
@PropertySource("classpath:client.apis.properties") 
@EnableWebMvc 
public class SpringConfiguration extends WebMvcConfigurerAdapter {
 
  @Inject 
  private Environment env;
   
  @Bean 
  public ViewResolver viewResolver() {
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
    viewResolver.setPrefix("/WEB-INF/jsp/");
    viewResolver.setSuffix(".jsp");
    return viewResolver;
  } 
   
  @Bean 
  public ClientController clientController() { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
@ComponentScan({"test.controllers"}) 
@Configuration 
@EnableWebMvc 
public class WebConfiguration extends WebMvcConfigurerAdapter {
	@Override 
	public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
		configurer.enable();
	} 
 
//	@Override 
//	public void configureAsyncSupport(AsyncSupportConfigurer configurer) { 
//		configurer.setDefaultTimeout(10000); 
//	} 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.web.servlet.view.JstlView;
import org.springframework.web.servlet.view.UrlBasedViewResolver;
 
@EnableWebMvc 
@Configuration 
public class WebConfig extends WebMvcConfigurerAdapter {
 
    @Bean 
    public UrlBasedViewResolver urlBasedViewResolver() {
        UrlBasedViewResolver resolver = new UrlBasedViewResolver();
        resolver.setViewClass(JstlView.class);
        return resolver;
    } 
 
    @Bean 
    public WebController webController() { 
        return new WebController(); 
    } 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package de.codecentric.moviedatabase.navigation.config; 
 
import org.springframework.context.annotation.Configuration; 
import org.springframework.context.annotation.Import; 
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 
 
@Configuration  
@Import(ControllerConfiguration.class) 
public class ApplicationConfiguration extends WebMvcConfigurerAdapter { 
	 
} 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 
import org.thymeleaf.templateresolver.UrlTemplateResolver; 
 
@Configuration  
@Import(ControllerConfiguration.class) 
public class ApplicationConfiguration extends WebMvcConfigurerAdapter { 
	 
	/** 
	 * This bean gets picked up automatically by {@link ThymeleafAutoConfiguration}. 
	 */ 
	@Bean 
	public UrlTemplateResolver urlTemplateResolver(){ 
		UrlTemplateResolver urlTemplateResolver = new UrlTemplateResolver(); 
		urlTemplateResolver.setOrder(20); 
		return urlTemplateResolver; 
	} 
	 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework WebMvcConfigurerAdapter Methods: