diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 18:13:59 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 18:13:59 +0530 |
| commit | 6ae21cd4e51756ea14b43b82a9d500bca9fb8032 (patch) | |
| tree | a330377fff7709cae00fe9d39c9281809e09aa75 /spring-boot/08-spring-security-simple/src/main/resources/templates/contact | |
| parent | fa880db84ec4507010a4d29b7cb0308f82553834 (diff) | |
Added 08-spring-security-simple
Diffstat (limited to 'spring-boot/08-spring-security-simple/src/main/resources/templates/contact')
| -rw-r--r-- | spring-boot/08-spring-security-simple/src/main/resources/templates/contact/form.html | 30 | ||||
| -rw-r--r-- | spring-boot/08-spring-security-simple/src/main/resources/templates/contact/result.html | 14 |
2 files changed, 44 insertions, 0 deletions
diff --git a/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/form.html b/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/form.html new file mode 100644 index 0000000..7debe1f --- /dev/null +++ b/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/form.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" th:replace="~{layout/main :: layout(title='Contact Us', content=~{::main})}"> + +<body> + <main> + <form th:action="@{/contact}" th:object="${contactForm}" method="post"> + <div class="form-field-container"> + <label>Name</label> + <input type="text" th:field="*{name}" placeholder="Your name" /> + <div class="validation-error" th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></div> + </div> + + <div class="form-field-container"> + <label>Email</label> + <input type="email" th:field="*{email}" placeholder="Your email" /> + <div class="validation-error" th:if="${#fields.hasErrors('email')}" th:errors="*{email}"></div> + </div> + + <div class="form-field-container"> + <label>Message</label> + <textarea th:field="*{message}" placeholder="Your message"></textarea> + <div class="validation-error" th:if="${#fields.hasErrors('message')}" th:errors="*{message}"></div> + </div> + + <button type="submit">Send</button> + </form> + </main> +</body> + +</html>
\ No newline at end of file diff --git a/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/result.html b/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/result.html new file mode 100644 index 0000000..d1bda9a --- /dev/null +++ b/spring-boot/08-spring-security-simple/src/main/resources/templates/contact/result.html @@ -0,0 +1,14 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" th:replace="~{layout/main :: layout(title='Contact Us', content=~{::main})}"> + +<body> + <main> + <p>We received your message.</p> + + <p th:text="'Thank you ' + ${contactForm.name} + '.'" /> + + <a th:href="@{/contact}">Try again</a> + </main> +</body> + +</html>
\ No newline at end of file |
