Spring Boot Thymeleaf CRUD example

In this tutorial, we’re gonna build a Spring Boot Thymeleaf CRUD example with Maven that use Spring Data JPA to interact with H2/MySQL/PostgreSQL database. You’ll know:

  • How to configure Spring Data, JPA, Hibernate to work with Database
  • How to define Data Entity and Repository interfaces
  • Way to create Spring Controller to process HTTP requests
  • Way to use Spring Data JPA to interact with H2/MySQL/PostgreSQL Database
  • How to use Thymeleaf template engine for View layer

Fullstack:
– Vue + Spring Boot example
– Angular 8 + Spring Boot example
– Angular 10 + Spring Boot example
– Angular 11 + Spring Boot example
– Angular 12 + Spring Boot example
– Angular 13 + Spring Boot example
– Angular 14 + Spring Boot example
– Angular 15 + Spring Boot example
– Angular 16 + Spring Boot example
– Angular 17 + Spring Boot example
– React + Spring Boot example

More Practice:
– Thymeleaf File Upload with Spring Boot
– Thymeleaf Pagination and Sorting example in Spring Boot
Exception Handling:
– Spring Boot @ControllerAdvice & @ExceptionHandler example
– @RestControllerAdvice example in Spring Boot
Testing:
– Spring Boot Unit Test for JPA Repository
– Spring Boot Unit Test for Rest Controller
Associations:
– Spring Boot One To One example with JPA, Hibernate
– Spring Boot One To Many example with JPA, Hibernate
– Spring Boot Many to Many example with JPA, Hibernate

Read More

Spring Security Refresh Token with JWT in Spring Boot

In previous post, we’ve known how to build Token based Authentication & Authorization with Spring Security & JWT. This tutorial will continue to make JWT Refresh Token with Spring Security in the Java Spring Boot Application. You can know how to expire the JWT Token, then renew the Access Token with Refresh Token and HttpOnly Cookie.

Related Posts:

Deployment:
– Deploy Spring Boot App on AWS – Elastic Beanstalk
– Docker Compose: Spring Boot and MySQL example
– Docker Compose: Spring Boot and Postgres example

The code in this post bases on previous article that you need to read first:
– Spring Boot JWT Auth example with H2 Database
– Spring Boot JWT Auth example with MySQL
– Spring Boot JWT Auth example with MongoDB

Read More

JPA/Hibernate One To One unidirectional mapping in Spring Boot

In this tutorial, I will show you how to implement Spring JPA One-To-One unidirectional mapping with Hibernate in a Spring Boot example using @OneToOne annotation. You’ll know:

  • How to configure Spring Data, JPA, Hibernate to work with Database
  • How to define Data Models and Repository interfaces for JPA One-To-One relationship
  • Way to use Spring JPA to interact with Database for One-To-One association
  • Way to create Spring Rest Controller to process HTTP requests

Related Posts:
– JPA One To Many example with Hibernate and Spring Boot
– JPA Many to Many example with Hibernate in Spring Boot
– Validate Request Body in Spring Boot
– Spring Boot Token based Authentication with Spring Security & JWT
– Spring JPA + H2 example
– Spring JPA + MySQL example
– Spring JPA + PostgreSQL example
– Spring JPA + Oracle example
– Spring JPA + SQL Server example
– Documentation: Spring Boot + Swagger 3 example (with OpenAPI 3)
– Caching: Spring Boot Redis Cache example

Read More