Package org.thymeleaf.templateresolver

Examples of org.thymeleaf.templateresolver.TemplateResolver


        initializeTemplateEngine(false, 3600000L);
    }

    private static void initializeTemplateEngine(boolean cacheable, Long timeToLive)
    {
        TemplateResolver templateResolver = new ClassLoaderTemplateResolver();
        templateResolver.setTemplateMode("HTML5");
        templateResolver.setSuffix(".html");
        templateResolver.setCacheable(cacheable);
        templateResolver.setCacheTTLMs(timeToLive);

        templateEngine = new TemplateEngine();
        templateEngine.setTemplateResolver(templateResolver);
    }
View Full Code Here


            prefix = views;
        } else {
            prefix = views.endsWith("/") ? views : views + "/";
        }

        templateResolver = new TemplateResolver();

        // XHTML is the default mode, but we will set it anyway for better understanding of code
        templateResolver.setTemplateMode("XHTML");
        templateResolver.setPrefix(prefix);
    }
View Full Code Here

        return messageSource;
    }

    @Bean
    public TemplateResolver templateResolver() {
        TemplateResolver templateResolver = new ServletContextTemplateResolver();
        templateResolver.setPrefix(VIEWS);
        templateResolver.setSuffix(".html");
        templateResolver.setTemplateMode("HTML5");
        templateResolver.setCacheable(false);
        return templateResolver;
    }
View Full Code Here

        return messageSource;
    }

    @Bean
    public TemplateResolver templateResolver() {
        TemplateResolver templateResolver = new ServletContextTemplateResolver();
        templateResolver.setPrefix(VIEWS);
        templateResolver.setSuffix(".html");
        templateResolver.setTemplateMode("HTML5");
        templateResolver.setCacheable(false);
        return templateResolver;
    }
View Full Code Here

      throw new ConfigurationException("Can not load property file " + propFileName, e);
    }

    {
      myProfileTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new ProfileResourceResolver());
      myProfileTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
      myProfileTemplateEngine.setDialect(dialect);
      myProfileTemplateEngine.initialize();
    }
    {
      myTitleTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new TitleResourceResolver());
      myTitleTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
View Full Code Here

      throw new ConfigurationException("Can not load property file " + propFileName, e);
    }

    {
      myProfileTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new ProfileResourceResolver());
      myProfileTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
      myProfileTemplateEngine.setDialect(dialect);
      myProfileTemplateEngine.initialize();
    }
    {
      myTitleTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new TitleResourceResolver());
      myTitleTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
View Full Code Here

  }

  @Override
  public void init(ServletConfig theConfig) throws ServletException {
    myTemplateEngine = new TemplateEngine();
    TemplateResolver resolver = new TemplateResolver();
    resolver.setResourceResolver(new ProfileResourceResolver());
    myTemplateEngine.setTemplateResolver(resolver);
    StandardDialect dialect = new StandardDialect();
    myTemplateEngine.setDialect(dialect);
    myTemplateEngine.initialize();
  }
View Full Code Here

      throw new ConfigurationException("Can not load property file " + propFileName, e);
    }

    {
      myProfileTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new ProfileResourceResolver());
      myProfileTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
View Full Code Here

      throw new ConfigurationException("Can not load property file " + propFileName, e);
    }

    {
      myProfileTemplateEngine = new TemplateEngine();
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(new ProfileResourceResolver());
      myProfileTemplateEngine.setTemplateResolver(resolver);
      StandardDialect dialect = new StandardDialect();
      HashSet<IProcessor> additionalProcessors = new HashSet<IProcessor>();
      additionalProcessors.add(new NarrativeAttributeProcessor());
      dialect.setAdditionalProcessors(additionalProcessors);
View Full Code Here

      }
    }

    @Bean
    public ITemplateResolver defaultTemplateResolver() {
      TemplateResolver resolver = new TemplateResolver();
      resolver.setResourceResolver(thymeleafResourceResolver());
      resolver.setPrefix(this.properties.getPrefix());
      resolver.setSuffix(this.properties.getSuffix());
      resolver.setTemplateMode(this.properties.getMode());
      resolver.setCharacterEncoding(this.properties.getEncoding());
      resolver.setCacheable(this.properties.isCache());
      return resolver;
    }
View Full Code Here

TOP

Related Classes of org.thymeleaf.templateresolver.TemplateResolver

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.