Remove support for Thymeleaf

Closes gh-28611
This commit is contained in:
Scott Frederick
2021-11-11 15:02:51 -06:00
committed by Andy Wilkinson
parent 22cc9ca6fa
commit 015dca1956
60 changed files with 19 additions and 2293 deletions

View File

@@ -1,33 +0,0 @@
package app
@Grab("thymeleaf-spring5")
@Controller
class Example {
@RequestMapping("/")
public String helloWorld(Map<String,Object> model) {
model.putAll([title: "My Page", date: new Date(), message: "Hello World"])
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
}
}

View File

@@ -87,15 +87,6 @@ class SampleIntegrationTests {
assertThat(this.cli.getHttpOutput()).isEqualTo("World!");
}
@Test
void uiSample() throws Exception {
this.cli.run("ui.groovy", "--classpath=.:src/test/resources");
String result = this.cli.getHttpOutput();
assertThat(result).contains("Hello World");
result = this.cli.getHttpOutput("/css/bootstrap.min.css");
assertThat(result).contains("container");
}
@Test
void actuatorSample() throws Exception {
this.cli.run("actuator.groovy");

View File

@@ -1,25 +0,0 @@
<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
<title th:text="${title}">Title</title>
<link rel="stylesheet" th:href="@{/resources/css/bootstrap.min.css}"
href="../../resources/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="https://www.thymeleaf.org"> Thymeleaf -
Plain </a>
<ul class="nav">
<li><a th:href="@{/}" href="home.html"> Home </a></li>
</ul>
</div>
</div>
<h1 th:text="${title}">Title</h1>
<div th:text="${message}">Fake content</div>
<div id="created" th:text="${#dates.format(date)}">July 11,
2012 2:17:16 PM CDT</div>
</div>
</body>
</html>