You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2018/06/15 18:18:13 UTC
[sling-samples] branch master updated: adjust to latest changes in
Scripting Thymeleaf
This is an automated email from the ASF dual-hosted git repository.
olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-samples.git
The following commit(s) were added to refs/heads/master by this push:
new c357856 adjust to latest changes in Scripting Thymeleaf
c357856 is described below
commit c35785648a9aa9393d8ef84131616b7bf86544bf
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Jun 15 15:20:19 2018 +0200
adjust to latest changes in Scripting Thymeleaf
---
fling/pom.xml | 13 +++++++------
.../apache/sling/samples/fling/internal/FormServlet.java | 4 ++--
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/fling/pom.xml b/fling/pom.xml
index 0d0ec76..cbdc0da 100644
--- a/fling/pom.xml
+++ b/fling/pom.xml
@@ -110,12 +110,6 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.scripting.thymeleaf</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.validation.api</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
@@ -127,6 +121,13 @@
<version>2.12.2</version>
<scope>provided</scope>
</dependency>
+ <!-- Thymeleaf -->
+ <dependency>
+ <groupId>org.thymeleaf</groupId>
+ <artifactId>thymeleaf</artifactId>
+ <version>3.0.9.RELEASE</version>
+ <scope>provided</scope>
+ </dependency>
<!-- SubEtha SMTP -->
<dependency>
<groupId>org.subethamail</groupId>
diff --git a/fling/src/main/java/org/apache/sling/samples/fling/internal/FormServlet.java b/fling/src/main/java/org/apache/sling/samples/fling/internal/FormServlet.java
index b7c63cb..84cfb33 100644
--- a/fling/src/main/java/org/apache/sling/samples/fling/internal/FormServlet.java
+++ b/fling/src/main/java/org/apache/sling/samples/fling/internal/FormServlet.java
@@ -45,7 +45,6 @@ import org.apache.sling.commons.messaging.MessageService;
import org.apache.sling.commons.messaging.Result;
import org.apache.sling.samples.fling.form.Form;
import org.apache.sling.samples.fling.form.FormFactory;
-import org.apache.sling.scripting.thymeleaf.DefaultSlingContext;
import org.apache.sling.validation.ValidationResult;
import org.apache.sling.validation.ValidationService;
import org.apache.sling.validation.model.ValidationModel;
@@ -57,6 +56,7 @@ import org.osgi.service.component.annotations.ReferencePolicyOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.thymeleaf.ITemplateEngine;
+import org.thymeleaf.context.Context;
import org.thymeleaf.context.IContext;
@Component(
@@ -149,7 +149,7 @@ public class FormServlet extends SlingAllMethodsServlet {
final String message;
try (final ResourceResolver resourceResolver = resourceResolverFactory.getServiceResourceResolver(null)) {
- final IContext context = new DefaultSlingContext(resourceResolver, Locale.ENGLISH, variables);
+ final IContext context = new Context(Locale.ENGLISH, variables);
logger.debug("rendering message template '{}' with variables: {}", template, variables);
message = templateEngine.process(template, context);
} catch (Exception e) { // TODO
--
To stop receiving notification emails like this one, please contact
olli@apache.org.