Reinstate support for Thymeleaf

This commit is contained in:
Andy Wilkinson
2022-01-06 13:28:05 +00:00
parent e95f038c01
commit 12cd97a20c
60 changed files with 2304 additions and 30 deletions

View File

@@ -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.
@@ -87,6 +87,15 @@ 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

@@ -0,0 +1,25 @@
<!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>