From 8fc60b3ccd9fd076004d61c2bc190aaedd073c46 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sat, 6 Jun 2026 21:00:32 +0530 Subject: Added Spring Boot DevTools support and css to the project --- .../src/main/resources/config/application-dev.properties | 10 ++++++++++ .../src/main/resources/static/css/main.css | 13 +++++++++++++ .../src/main/resources/templates/contact/form.html | 13 +++++++------ .../src/main/resources/templates/contact/result.html | 1 + .../src/main/resources/templates/index.html | 1 + 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 spring-boot/06-form-handling-with-thymeleaf/src/main/resources/config/application-dev.properties create mode 100644 spring-boot/06-form-handling-with-thymeleaf/src/main/resources/static/css/main.css (limited to 'spring-boot/06-form-handling-with-thymeleaf/src/main') diff --git a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/config/application-dev.properties b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/config/application-dev.properties new file mode 100644 index 0000000..f0f380b --- /dev/null +++ b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/config/application-dev.properties @@ -0,0 +1,10 @@ +# This file contains settings used during development. +# If using Maven to run, try the following command: +# mvn spring-boot:run -Dspring-boot.run.profiles=dev + +# Disable caching for static resources +spring.web.resources.cache.period=0 +spring.thymeleaf.cache=false + +# Optional: Tell DevTools to watch changes but never restart the backend server for CSS +spring.devtools.restart.exclude=static/**,public/**,templates/** diff --git a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/static/css/main.css b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/static/css/main.css new file mode 100644 index 0000000..8fcc7b3 --- /dev/null +++ b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/static/css/main.css @@ -0,0 +1,13 @@ +.form-field-container { + margin-top: 8px; + margin-bottom: 8px; +} + +.form-field-container label { + display: inline-block; + width: 5em; +} + +.form-field-container .validation-error { + color: red; +} \ No newline at end of file diff --git a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/form.html b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/form.html index 0229e0d..52f51f2 100644 --- a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/form.html +++ b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/form.html @@ -4,28 +4,29 @@ Contact Us +

Contact Us

-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/result.html b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/result.html index 1bb4b45..607a9eb 100644 --- a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/result.html +++ b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/contact/result.html @@ -3,6 +3,7 @@ Contact Us +

Contact Us

diff --git a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/index.html b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/index.html index 48e251d..9259f47 100644 --- a/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/index.html +++ b/spring-boot/06-form-handling-with-thymeleaf/src/main/resources/templates/index.html @@ -4,6 +4,7 @@ Form handling example with Thymeleaf + -- cgit v1.2.3