Package org.thymeleaf.spring3.view

Examples of org.thymeleaf.spring3.view.ThymeleafViewResolver


@Configuration
public class CustomMvcConfig {

    @Bean
    public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE - 10);
        viewResolver.setTemplateEngine(templateEngine);
        return viewResolver;
    }
View Full Code Here


        return templateEngine;
    }

    @Bean
    public ThymeleafViewResolver viewResolver(SpringTemplateEngine templateEngine) {
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        viewResolver.setTemplateEngine(templateEngine);
        viewResolver.setViewClass(ThymeleafTilesView.class);
        return viewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ViewResolver viewResolver(){
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver() ;
        viewResolver.setTemplateEngine(templateEngine());
        viewResolver.setOrder(1);

        return viewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ViewResolver viewResolver(){
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver() ;
        viewResolver.setTemplateEngine(templateEngine());
        viewResolver.setOrder(1);

        return viewResolver;
    }
View Full Code Here

    return templateResolver;
  }

  @Bean
  public ThymeleafViewResolver viewResolver() {
    ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
    viewResolver.setViewClass(ThymeleafTilesView.class);
    viewResolver.setTemplateEngine(templateEngine());
    viewResolver.setCharacterEncoding("UTF-8");
    return viewResolver;
  }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ThymeleafViewResolver viewResolver() {
        ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
        thymeleafViewResolver.setTemplateEngine(templateEngine());
        thymeleafViewResolver.setCharacterEncoding("UTF-8");
        return thymeleafViewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ThymeleafViewResolver viewResolver() {
        ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
        thymeleafViewResolver.setTemplateEngine(templateEngine());
        thymeleafViewResolver.setCharacterEncoding("UTF-8");
        return thymeleafViewResolver;
    }
View Full Code Here

    private SpringTemplateEngine templateEngine;

    @Bean
    @ConditionalOnMissingBean(name = "thymeleafViewResolver")
    public ThymeleafViewResolver thymeleafViewResolver() {
      ThymeleafViewResolver resolver = new ThymeleafViewResolver();
      resolver.setTemplateEngine(this.templateEngine);
      resolver.setCharacterEncoding(this.properties.getEncoding());
      resolver.setContentType(appendCharset(this.properties.getContentType(),
          resolver.getCharacterEncoding()));
      resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
      resolver.setViewNames(this.properties.getViewNames());
      // This resolver acts as a fallback resolver (e.g. like a
      // InternalResourceViewResolver) so it needs to have low precedence
      resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
      return resolver;
    }
View Full Code Here

    this.context.refresh();
    this.context.getBean(TemplateEngine.class).initialize();
    ITemplateResolver resolver = this.context.getBean(ITemplateResolver.class);
    assertTrue(resolver instanceof TemplateResolver);
    assertEquals("UTF-16", ((TemplateResolver) resolver).getCharacterEncoding());
    ThymeleafViewResolver views = this.context.getBean(ThymeleafViewResolver.class);
    assertEquals("UTF-16", views.getCharacterEncoding());
    assertEquals("text/html;charset=UTF-16", views.getContentType());
  }
View Full Code Here

    EnvironmentTestUtils.addEnvironment(this.context,
        "spring.thymeleaf.viewNames:foo,bar");
    this.context.register(ThymeleafAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    ThymeleafViewResolver views = this.context.getBean(ThymeleafViewResolver.class);
    assertArrayEquals(new String[] { "foo", "bar" }, views.getViewNames());
  }
View Full Code Here

TOP

Related Classes of org.thymeleaf.spring3.view.ThymeleafViewResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.