Class ThymeleafTemplater

java.lang.Object
com.peterphi.std.guice.web.rest.templating.thymeleaf.ThymeleafTemplater
All Implemented Interfaces:
Templater

public class ThymeleafTemplater extends Object implements Templater
Light abstraction over a ThymeLeaf TemplateEngine allowing cleaner construction of the current web context (when the template engine is being used inside an http call).
Exposes the following special variables:
  • currentUser - of type ThymeleafCurrentUserUtils
  • Constructor Details

    • ThymeleafTemplater

      @Inject public ThymeleafTemplater(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider)
    • ThymeleafTemplater

      public ThymeleafTemplater(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider, boolean isTransientInstance)
      Parameters:
      engine - thymeleaf template engine to use
      configuration - full guice config
      metrics - metrics
      userProvider - user provider
      isTransientInstance - if true, will skip registering the TemplateEngine with the CacheManager
  • Method Details