From 959364fa12086d6dbd0390288735866522d20403 Mon Sep 17 00:00:00 2001 From: djmil Date: Wed, 26 Jul 2023 10:55:39 +0200 Subject: [PATCH] Interactivity --- README.md | 26 ++++++++++++++++++++++ src/main/resources/templates/greeting.html | 16 ++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4db595b..19cab6b 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,30 @@ Thymeleaf parses the `greeting.html` template and evaluates the `th:text` exp

+``` + +# Interactivity + +Let's add minimal interactivity to the page by introducing an input field and a button. On the button press, a simple JavaScript will reload the page (by calling [[README#Web Controller]] 's `Get` endpoint) providing a value from the input filed as a URL parameter. + +```html +... + +

+ + + + + + ``` \ No newline at end of file diff --git a/src/main/resources/templates/greeting.html b/src/main/resources/templates/greeting.html index 79c2493..7c617d8 100644 --- a/src/main/resources/templates/greeting.html +++ b/src/main/resources/templates/greeting.html @@ -6,5 +6,19 @@

+ + - \ No newline at end of file + + + \ No newline at end of file