Commit 6ad23b1c authored by Phillip Webb's avatar Phillip Webb

Merge pull request #2113 from BigMichi1/thymleaf-conditional-comments

* thymleaf-conditional-comments:
  Auto-configure for Thymeleaf conditionalcomments
parents 5c27cba8 3b858edf
......@@ -375,6 +375,11 @@
<artifactId>thymeleaf-extras-data-attribute</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-conditionalcomments</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
......
......@@ -41,6 +41,7 @@ import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.Assert;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.extras.conditionalcomments.dialect.ConditionalCommentsDialect;
import org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.resourceresolver.SpringResourceResourceResolver;
......@@ -163,6 +164,18 @@ public class ThymeleafAutoConfiguration {
}
@Configuration
@ConditionalOnClass(ConditionalCommentsDialect.class)
protected static class ThymeleafConditionalCommentsDialectConfiguration {
@Bean
@ConditionalOnMissingBean
public ConditionalCommentsDialect conditionalCommentsDialect() {
return new ConditionalCommentsDialect();
}
}
@Configuration
@ConditionalOnClass({ Servlet.class })
@ConditionalOnWebApplication
......
......@@ -127,6 +127,7 @@
<sun-mail.version>${javax-mail.version}</sun-mail.version>
<thymeleaf.version>2.1.3.RELEASE</thymeleaf.version>
<thymeleaf-extras-springsecurity3.version>2.1.1.RELEASE</thymeleaf-extras-springsecurity3.version>
<thymeleaf-extras-conditionalcomments.version>2.1.1.RELEASE</thymeleaf-extras-conditionalcomments.version>
<thymeleaf-layout-dialect.version>1.2.7</thymeleaf-layout-dialect.version>
<thymeleaf-extras-data-attribute.version>1.3</thymeleaf-extras-data-attribute.version>
<tomcat.version>8.0.15</tomcat.version>
......@@ -1404,6 +1405,11 @@
<artifactId>thymeleaf-spring4</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-conditionalcomments</artifactId>
<version>${thymeleaf-extras-conditionalcomments.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment