Skip to content

rish2408/Server-Side-Form-Validation-Spring-Boot-Thymeleaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Server Side Form Validation With Spring Boot (Backend) and Thymeleaf (Frontend)

  • This project demonstrates how to perform server-side form validation with Spring Boot and Thymeleaf.

Technologies Used

  • Java 11
  • Spring Boot 3.0.4
  • Thymeleaf 3.0.12
  • Bootstrap 5.0.2

Overview

  • The project contains a single controller class, MyController, which handles two requests:
GET /sign-in: This request renders the login form using Thymeleaf.
POST /success: This request processes the form submission and performs validation. If validation fails, the user is redirected back to the form with error messages. If validation succeeds, the user is redirected to the success page.
  • The Form class is a simple POJO that represents the form data. It contains validation annotations from the Jakarta Bean Validation API.

  • The form.html template uses Bootstrap for styling and Thymeleaf to bind the form data and validation errors to the HTML form.

Screenshots

1 2 3 4

Contributions

  • Contributions are welcome! If you find a bug or want to add a feature, please create an issue or submit a pull request.

Thank-You

Releases

No releases published

Packages

No packages published