diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 2b7b9a0999..4e10597902 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -178,9 +178,9 @@ dependencies { exclude group: "jakarta.mail", module: "jakarta.mail-api" } optional("org.thymeleaf:thymeleaf") - optional("org.thymeleaf:thymeleaf-spring5") + optional("org.thymeleaf:thymeleaf-spring6") optional("org.thymeleaf.extras:thymeleaf-extras-java8time") - optional("org.thymeleaf.extras:thymeleaf-extras-springsecurity5") + optional("org.thymeleaf.extras:thymeleaf-extras-springsecurity6") optional("redis.clients:jedis") testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/TemplateEngineConfigurations.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/TemplateEngineConfigurations.java new file mode 100644 index 0000000000..62bac976e1 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/TemplateEngineConfigurations.java @@ -0,0 +1,79 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.thymeleaf; + +import org.thymeleaf.ITemplateEngine; +import org.thymeleaf.dialect.IDialect; +import org.thymeleaf.spring6.ISpringTemplateEngine; +import org.thymeleaf.spring6.ISpringWebFluxTemplateEngine; +import org.thymeleaf.spring6.SpringTemplateEngine; +import org.thymeleaf.spring6.SpringWebFluxTemplateEngine; +import org.thymeleaf.templateresolver.ITemplateResolver; + +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Configuration classes for Thymeleaf's {@link ITemplateEngine}. Imported by + * {@link ThymeleafAutoConfiguration}. + * + * @author Andy Wilkinson + */ +class TemplateEngineConfigurations { + + @Configuration(proxyBeanMethods = false) + static class DefaultTemplateEngineConfiguration { + + @Bean + @ConditionalOnMissingBean(ISpringTemplateEngine.class) + SpringTemplateEngine templateEngine(ThymeleafProperties properties, + ObjectProvider templateResolvers, ObjectProvider dialects) { + SpringTemplateEngine engine = new SpringTemplateEngine(); + engine.setEnableSpringELCompiler(properties.isEnableSpringElCompiler()); + engine.setRenderHiddenMarkersBeforeCheckboxes(properties.isRenderHiddenMarkersBeforeCheckboxes()); + templateResolvers.orderedStream().forEach(engine::addTemplateResolver); + dialects.orderedStream().forEach(engine::addDialect); + return engine; + } + + } + + @Configuration(proxyBeanMethods = false) + @ConditionalOnWebApplication(type = Type.REACTIVE) + @ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true) + static class ReactiveTemplateEngineConfiguration { + + @Bean + @ConditionalOnMissingBean(ISpringWebFluxTemplateEngine.class) + SpringWebFluxTemplateEngine templateEngine(ThymeleafProperties properties, + ObjectProvider templateResolvers, ObjectProvider dialects) { + SpringWebFluxTemplateEngine engine = new SpringWebFluxTemplateEngine(); + engine.setEnableSpringELCompiler(properties.isEnableSpringElCompiler()); + engine.setRenderHiddenMarkersBeforeCheckboxes(properties.isRenderHiddenMarkersBeforeCheckboxes()); + templateResolvers.orderedStream().forEach(engine::addTemplateResolver); + dialects.orderedStream().forEach(engine::addDialect); + return engine; + } + + } + +} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index 823e75e5a2..dbe40cc154 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,26 +18,21 @@ package org.springframework.boot.autoconfigure.thymeleaf; import java.util.LinkedHashMap; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect; import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.thymeleaf.dialect.IDialect; import org.thymeleaf.extras.java8time.dialect.Java8TimeDialect; -import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect; -import org.thymeleaf.spring5.ISpringTemplateEngine; -import org.thymeleaf.spring5.ISpringWebFluxTemplateEngine; -import org.thymeleaf.spring5.SpringTemplateEngine; -import org.thymeleaf.spring5.SpringWebFluxTemplateEngine; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; -import org.thymeleaf.spring5.view.ThymeleafViewResolver; -import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver; +import org.thymeleaf.extras.springsecurity6.dialect.SpringSecurityDialect; +import org.thymeleaf.spring6.ISpringWebFluxTemplateEngine; +import org.thymeleaf.spring6.SpringTemplateEngine; +import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.spring6.view.ThymeleafViewResolver; +import org.thymeleaf.spring6.view.reactive.ThymeleafReactiveViewResolver; import org.thymeleaf.templatemode.TemplateMode; -import org.thymeleaf.templateresolver.ITemplateResolver; -import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -57,6 +52,7 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.core.Ordered; import org.springframework.util.MimeType; import org.springframework.util.unit.DataSize; @@ -79,6 +75,8 @@ import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter; @EnableConfigurationProperties(ThymeleafProperties.class) @ConditionalOnClass({ TemplateMode.class, SpringTemplateEngine.class }) @AutoConfigureAfter({ WebMvcAutoConfiguration.class, WebFluxAutoConfiguration.class }) +@Import({ TemplateEngineConfigurations.ReactiveTemplateEngineConfiguration.class, + TemplateEngineConfigurations.DefaultTemplateEngineConfiguration.class }) public class ThymeleafAutoConfiguration { @Configuration(proxyBeanMethods = false) @@ -129,23 +127,6 @@ public class ThymeleafAutoConfiguration { } - @Configuration(proxyBeanMethods = false) - protected static class ThymeleafDefaultConfiguration { - - @Bean - @ConditionalOnMissingBean(ISpringTemplateEngine.class) - SpringTemplateEngine templateEngine(ThymeleafProperties properties, - ObjectProvider templateResolvers, ObjectProvider dialects) { - SpringTemplateEngine engine = new SpringTemplateEngine(); - engine.setEnableSpringELCompiler(properties.isEnableSpringElCompiler()); - engine.setRenderHiddenMarkersBeforeCheckboxes(properties.isRenderHiddenMarkersBeforeCheckboxes()); - templateResolvers.orderedStream().forEach(engine::addTemplateResolver); - dialects.orderedStream().forEach(engine::addDialect); - return engine; - } - - } - @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true) @@ -198,25 +179,6 @@ public class ThymeleafAutoConfiguration { } - @Configuration(proxyBeanMethods = false) - @ConditionalOnWebApplication(type = Type.REACTIVE) - @ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true) - static class ThymeleafReactiveConfiguration { - - @Bean - @ConditionalOnMissingBean(ISpringWebFluxTemplateEngine.class) - SpringWebFluxTemplateEngine templateEngine(ThymeleafProperties properties, - ObjectProvider templateResolvers, ObjectProvider dialects) { - SpringWebFluxTemplateEngine engine = new SpringWebFluxTemplateEngine(); - engine.setEnableSpringELCompiler(properties.isEnableSpringElCompiler()); - engine.setRenderHiddenMarkersBeforeCheckboxes(properties.isRenderHiddenMarkersBeforeCheckboxes()); - templateResolvers.orderedStream().forEach(engine::addTemplateResolver); - dialects.orderedStream().forEach(engine::addDialect); - return engine; - } - - } - @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = Type.REACTIVE) @ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java index 4c5a7267c2..d1906b67d4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class ThymeleafTemplateAvailabilityProvider implements TemplateAvailabili @Override public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) { - if (ClassUtils.isPresent("org.thymeleaf.spring5.SpringTemplateEngine", classLoader)) { + if (ClassUtils.isPresent("org.thymeleaf.spring6.SpringTemplateEngine", classLoader)) { String prefix = environment.getProperty("spring.thymeleaf.prefix", ThymeleafProperties.DEFAULT_PREFIX); String suffix = environment.getProperty("spring.thymeleaf.suffix", ThymeleafProperties.DEFAULT_SUFFIX); return resourceLoader.getResource(prefix + view + suffix).exists(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java index b8af5c3adc..b69c536b03 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.boot.autoconfigure.thymeleaf; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Locale; @@ -26,13 +27,13 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; -import org.thymeleaf.context.IContext; -import org.thymeleaf.extras.springsecurity5.util.SpringSecurityContextUtils; -import org.thymeleaf.spring5.ISpringWebFluxTemplateEngine; -import org.thymeleaf.spring5.SpringWebFluxTemplateEngine; -import org.thymeleaf.spring5.context.webflux.SpringWebFluxContext; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; -import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver; +import org.thymeleaf.context.WebContext; +import org.thymeleaf.extras.springsecurity6.util.SpringSecurityContextUtils; +import org.thymeleaf.spring6.ISpringWebFluxTemplateEngine; +import org.thymeleaf.spring6.SpringWebFluxTemplateEngine; +import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.spring6.view.reactive.ThymeleafReactiveViewResolver; +import org.thymeleaf.spring6.web.webflux.SpringWebFluxWebApplication; import org.thymeleaf.templateresolver.ITemplateResolver; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -198,7 +199,8 @@ class ThymeleafReactiveAutoConfigurationTests { MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/test").build()); exchange.getAttributes().put(SpringSecurityContextUtils.SECURITY_CONTEXT_MODEL_ATTRIBUTE_NAME, new SecurityContextImpl(new TestingAuthenticationToken("alice", "admin"))); - IContext attrs = new SpringWebFluxContext(exchange); + WebContext attrs = new WebContext(SpringWebFluxWebApplication.buildApplication(null).buildExchange(exchange, + Locale.US, MediaType.TEXT_HTML, StandardCharsets.UTF_8)); String result = engine.process("security-dialect", attrs); assertThat(result).isEqualTo("
alice
" + System.lineSeparator()); }); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java index aca83cdff0..2daa041fa9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,8 @@ import java.util.EnumSet; import java.util.Locale; import java.util.Map; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContext; import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect; import nz.net.ultraq.thymeleaf.layoutdialect.decorators.strategies.GroupingStrategy; @@ -31,11 +32,12 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; import org.thymeleaf.context.WebContext; -import org.thymeleaf.spring5.SpringTemplateEngine; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; -import org.thymeleaf.spring5.view.ThymeleafView; -import org.thymeleaf.spring5.view.ThymeleafViewResolver; +import org.thymeleaf.spring6.SpringTemplateEngine; +import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.spring6.view.ThymeleafView; +import org.thymeleaf.spring6.view.ThymeleafViewResolver; import org.thymeleaf.templateresolver.ITemplateResolver; +import org.thymeleaf.web.servlet.JakartaServletWebApplication; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.FilteredClassLoader; @@ -81,7 +83,7 @@ class ThymeleafServletAutoConfigurationTests { @Test void autoConfigurationBackOffWithoutThymeleafSpring() { - this.contextRunner.withClassLoader(new FilteredClassLoader("org.thymeleaf.spring5")) + this.contextRunner.withClassLoader(new FilteredClassLoader("org.thymeleaf.spring6")) .run((context) -> assertThat(context).doesNotHaveBean(TemplateEngine.class)); } @@ -183,7 +185,7 @@ class ThymeleafServletAutoConfigurationTests { ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class).resolveViewName("view", Locale.UK); MockHttpServletResponse response = new MockHttpServletResponse(); - MockHttpServletRequest request = new MockHttpServletRequest(); + MockHttpServletRequest request = new MockHttpServletRequest(context.getBean(ServletContext.class)); request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context); view.render(Collections.singletonMap("foo", "bar"), request, response); String result = response.getContentAsString(); @@ -217,8 +219,10 @@ class ThymeleafServletAutoConfigurationTests { void useSecurityDialect() { this.contextRunner.run((context) -> { TemplateEngine engine = context.getBean(TemplateEngine.class); - WebContext attrs = new WebContext(new MockHttpServletRequest(), new MockHttpServletResponse(), - new MockServletContext()); + MockServletContext servletContext = new MockServletContext(); + JakartaServletWebApplication webApplication = JakartaServletWebApplication.buildApplication(servletContext); + WebContext attrs = new WebContext(webApplication.buildExchange(new MockHttpServletRequest(servletContext), + new MockHttpServletResponse())); try { SecurityContextHolder .setContext(new SecurityContextImpl(new TestingAuthenticationToken("alice", "admin"))); diff --git a/spring-boot-project/spring-boot-cli/samples/ui.groovy b/spring-boot-project/spring-boot-cli/samples/ui.groovy index a13a2775a9..e5a04e630f 100644 --- a/spring-boot-project/spring-boot-cli/samples/ui.groovy +++ b/spring-boot-project/spring-boot-cli/samples/ui.groovy @@ -1,6 +1,6 @@ package app -@Grab("thymeleaf-spring5") +@Grab("thymeleaf-spring6") @Controller class Example { @@ -10,24 +10,3 @@ class Example { return "home" } } - -@Configuration(proxyBeanMethods = false) -@Log -class MvcConfiguration extends WebMvcConfigurerAdapter { - - @Override - void addInterceptors(InterceptorRegistry registry) { - log.info "Registering interceptor" - registry.addInterceptor(interceptor()) - } - - @Bean - HandlerInterceptor interceptor() { - log.info "Creating interceptor" - [ - postHandle: { request, response, handler, mav -> - log.info "Intercepted: model=" + mav.model - } - ] as HandlerInterceptorAdapter - } -} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml b/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml index bbe1ac0ed3..b85b5c25ff 100644 --- a/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml +++ b/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml @@ -17,7 +17,17 @@ true + + thymeleaf-snapshot + https://oss.sonatype.org/content/repositories/snapshots + + true + + + true + + - \ No newline at end of file + diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index bc0c9b7f61..17aa15280a 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1436,11 +1436,11 @@ bom { ] } } - library("Thymeleaf", "3.0.12.RELEASE") { + library("Thymeleaf", "3.1.0.M1") { group("org.thymeleaf") { modules = [ "thymeleaf", - "thymeleaf-spring5" + "thymeleaf-spring6" ] } } @@ -1458,10 +1458,10 @@ bom { ] } } - library("Thymeleaf Extras SpringSecurity", "3.0.4.RELEASE") { + library("Thymeleaf Extras SpringSecurity", "3.1.0.M1") { group("org.thymeleaf.extras") { modules = [ - "thymeleaf-extras-springsecurity5" + "thymeleaf-extras-springsecurity6" ] } } diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index aba3677935..c75683d2a0 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -207,7 +207,6 @@ task aggregatedJavadoc(type: Javadoc) { "https://docs.spring.io/spring-security/site/docs/${versionConstraints["org.springframework.security:spring-security-core"]}/api/", "https://jakarta.ee/specifications/platform/9/apidocs/", "https://tomcat.apache.org/tomcat-${tomcatDocsVersion}-doc/api/", - "https://www.thymeleaf.org/apidocs/thymeleaf/${versionConstraints["org.thymeleaf:thymeleaf"]}/" ] as String[] } } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle index a3a0cefe18..2862bac5fa 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle @@ -6,6 +6,6 @@ description = "Starter for building MVC web applications using Thymeleaf views" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) - api("org.thymeleaf:thymeleaf-spring5") + api("org.thymeleaf:thymeleaf-spring6") api("org.thymeleaf.extras:thymeleaf-extras-java8time") } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/Message.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/Message.java index 553ee9e7a4..a90f8d7fc3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/Message.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ package smoketest.web.thymeleaf; import java.util.Calendar; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class Message { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/mvc/MessageController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/mvc/MessageController.java index 350b20d8cc..15aefcd004 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/mvc/MessageController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/mvc/MessageController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package smoketest.web.thymeleaf.mvc; -import javax.validation.Valid; +import jakarta.validation.Valid; import smoketest.web.thymeleaf.Message; import smoketest.web.thymeleaf.MessageRepository;