org.thymeleaf.templateresource.StringTemplateResource Java Examples

The following examples show how to use org.thymeleaf.templateresource.StringTemplateResource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThymeleafViewResultHandler.java    From oxygen with Apache License 2.0 5 votes vote down vote up
@Override
protected ITemplateResource computeTemplateResource(IEngineConfiguration configuration,
    String ownerTemplate, String template, Map<String, Object> templateResolutionAttributes) {
  if (isCacheable()) {
    return new StringTemplateResource(Templates.cachedTemplate(prefix + template));
  }
  return new StringTemplateResource(Templates.template(prefix + template));
}
 
Example #2
Source File: ThymeleafTemplateEngineImpl.java    From vertx-web with Apache License 2.0 5 votes vote down vote up
@Override
protected ITemplateResource computeTemplateResource(IEngineConfiguration configuration, String ownerTemplate, String template, Map<String, Object> templateResolutionAttributes) {
  return new StringTemplateResource(
    vertx.fileSystem()
      .readFileBlocking(template)
      .toString(Charset.defaultCharset()));
}
 
Example #3
Source File: DomainBasedTemplateResolver.java    From graviteeio-access-management with Apache License 2.0 4 votes vote down vote up
public void addForm(String templateName, String templateContent) {
    templates.put(templateName, new StringTemplateResource(templateContent));
    templateEngine.getCacheManager().clearAllCaches();
}
 
Example #4
Source File: TemplateResolver.java    From graviteeio-access-management with Apache License 2.0 4 votes vote down vote up
public void addForm(String templateName, String templateContent) {
    templates.put(templateName, new StringTemplateResource(templateContent));
    templateEngine.getCacheManager().clearAllCaches();
}