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

This code example shows how to use the following methods:addViewController
@Configuration 
public class PushStateConfig extends WebMvcConfigurerAdapter {
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/").setViewName("forward:/index.html");
		registry.addViewController("/signin").setViewName("forward:/index.html");
		registry.addViewController("/photo").setViewName("forward:/index.html");
		registry.addViewController("/sent").setViewName("forward:/index.html");
		registry.addViewController("/received").setViewName("forward:/index.html");
		registry.addViewController("/admin").setViewName("forward:/index.html");
		registry.addViewController("/logout").setViewName("forward:/index.html");
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:addViewController
@Configuration 
public class MvcConfig extends WebMvcConfigurerAdapter {
     
    @Override 
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/home").setViewName("home");
        registry.addViewController("/").setViewName("home");
        registry.addViewController("/hello").setViewName("hello");
        registry.addViewController("/login").setViewName("login");
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:addViewController
@Configuration 
public class WebConfig extends WebMvcConfigurerAdapter {
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/hotels/partialsList").setViewName("hotels/partialsList::content");
		registry.addViewController("/hotels/partialsCreate").setViewName("hotels/partialsCreate::content");
		registry.addViewController("/hotels/partialsEdit").setViewName("hotels/partialsEdit::content");
		registry.addViewController("/mappings/partialsMappings").setViewName("mappings/partialsMappings::content");
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:addViewController
		return this.projectRoot; 
	} 
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) { 
		registry.addViewController("/").setViewName("index"); 
		registry.addViewController("/groovy").setViewName("hello"); 
		registry.addViewController("/app").setViewName("app"); 
		registry.addViewController("/less").setViewName("less"); 
		registry.addViewController("/jsp").setViewName("hellojsp"); 
	} 
 
	@Bean 
	public HandlebarsViewResolver handlebarsViewResolver(ResourceUrlProvider urlProvider) { 
		HandlebarsViewResolver resolver = new HandlebarsViewResolver(); 
		resolver.setPrefix("classpath:/handlebars/"); 
		resolver.registerHelper("src", new ResourceUrlHelper(urlProvider)); 
		resolver.registerHelper(ProfileHelper.NAME, new ProfileHelper(this.env.getActiveProfiles())); 
		resolver.setCache(!this.env.acceptsProfiles("development")); 
		resolver.setFailOnMissingFile(false); 
6
CodeRank
This code example shows how to use the following methods:addViewController
	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;
	} 
 
	private @Inject UsersConnectionRepository usersConnectionRepository;
 
} 
5
CodeRank
This code example shows how to use the following methods:addViewController
This code example shows how to use the following methods:addViewController
@ComponentScan(basePackages = "org.springframework.web.issues", excludeFilters = { @Filter(Configuration.class) }) 
public class WebConfig extends WebMvcConfigurationSupport { 
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) { 
		registry.addViewController("/").setViewName("home"); 
	} 
 
	@Bean 
	public InternalResourceViewResolver viewResolver() { 
		InternalResourceViewResolver resolver = new InternalResourceViewResolver(); 
		resolver.setPrefix("/WEB-INF/views/"); 
		resolver.setSuffix(".jsp"); 
		return resolver; 
	}	 
 
} 
5
CodeRank
This code example shows how to use the following methods:addViewController
		configurer.enable();
	} 
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/").setViewName("welcome");
		registry.addViewController("/home").setViewName("welcome");
		registry.addViewController("/denied").setViewName("denied");
	} 
 
	@Bean(name="tilesViewResolver") 
	public ViewResolver getTilesViewResolver() {
		TilesViewResolver resolver = new TilesViewResolver();
		resolver.setContentType("text/html");
		return resolver;
	} 
 
	@Bean 
	public TilesConfigurer getTilesConfigurer() {
		TilesConfigurer configurer = new TilesConfigurer();
5
CodeRank
This code example shows how to use the following methods:addViewController
	@Override 
	public void addViewControllers(ViewControllerRegistry registry)
	{ 
		super.addViewControllers(registry);
		 
		registry.addViewController("/login").setViewName("login");
		registry.addViewController("contact").setViewName("contact");
		registry.addViewController("admin").setViewName("admin");
	} 
	 
	@Bean 
	  public ServletContextTemplateResolver templateResolver() { 
	    ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();
	    resolver.setPrefix("/templates/");
	    resolver.setSuffix(".html");
	    //NB, selecting HTML5 as the template mode. 
	    resolver.setTemplateMode("HTML5");
	    resolver.setCacheable(false);
	    return resolver;
 
5
CodeRank
This code example shows how to use the following methods:addViewController
		configurer.enable(); 
	} 
 
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) { 
		registry.addViewController("/").setViewName("welcome"); 
		registry.addViewController("/home").setViewName("welcome"); 
		registry.addViewController("/denied").setViewName("denied"); 
	} 
 
 
	@Bean(name = "tilesConfigurer") 
	public TilesConfigurer getTilesConfigurer() { 
		TilesConfigurer configurer = new TilesConfigurer(); 
		String[] tilesDefFiles = { "/WEB-INF/tiles.xml", 
				"/WEB-INF/accounts/tiles.xml" }; 
		configurer.setDefinitions(tilesDefFiles); 
		return configurer; 
	} 
 
5
CodeRank
See Code Examples for Spring Framework ViewControllerRegistry Methods: