
Build a real-time blog app with Spring Boot 3 and Thymeleaf 3, featuring guest, admin, and reader roles. Implement post creation, editing, deletion, comments, search, and registration with CKEditor.
Present the high level requirements for a blog app, covering client features to view posts, search, comment, register, and admin controls to manage posts and comments with Spring Boot 3.
Understand Spring MVC as the core module for building web applications and RESTful services. See how the DispatcherServlet routes requests to controllers, with model, view, and controller components rendering HTML.
Explore how DispatcherServlet acts as the front controller in Spring MVC, routing all requests to the right controller and with Spring Boot Starter Web auto configuration rendering model and view.
Explore Spring MVC core components such as DispatcherServlet, controller, handler method, ViewResolver, view, and model, and learn how Spring Boot configures DispatcherServlet automatically for Thymeleaf.
Implement a three-layer Spring Boot web MVC architecture with controller, service, and repository layers, using Spring MVC, Spring Data JPA, Thymeleaf templates, and MySQL for data.
Thymeleaf is a modern server-side Java template engine that processes HTML, XML, JavaScript, CSS, and plain text, powering the view layer in Spring Boot MVC applications.
Create a spring boot 3 project with spring initializr, import it into IntelliJ IDEA, and add the spring boot starter thymeleaf dependency for thymeleaf integration.
Learn how Spring Boot auto-configures Thymeleaf when you add the Spring Boot starter Thymeleaf dependency, including automatic view resolver setup and default templates location.
Explore Thymeleaf selection expressions that run on a previously selected object using th:object and the *{} syntax to access attributes such as name, email, role, and gender.
Learn how Thymeleaf message expressions externalise common text into a properties file and access keys like app.name and welcome.message in templates using th:text.
Learn how Thymeleaf link expressions build urls in templates using @{} syntax, pass dynamic parameters such as id, and link to an external css file.
Discover how to use Thymeleaf fragment expressions to create reusable header and footer fragments and include or replace them in templates with th:replace and th:insert.
Explore how th:each enables iteration over list, set, map, and array, printing user name, email, role, and gender from Spring MVC model with a status variable for index and last.
Master Thymeleaf th:if and th:unless to conditionally render elements, and use th:each to list users with admin-specific update and delete links, or a view link for non-admins.
Explore Thymeleaf form handling in a Spring Boot 3 app, mastering th:action, th:object, and th:field to bind form data to a UserForm model and prepare registration handling.
Design a user registration form using thymeleaf templates bound to the UserForm model, apply th:object and th:field for inputs, populate the profession select from listProfession, and submit to /register/save.
Explore how the Spring Boot starter Thymeleaf dependency auto-configures Thymeleaf and ViewResolver, with templates in resources/templates and support for Thymeleaf layout dialect, Spring Security dialect, and Java eight time dialect.
Create a standard packaging structure for a Spring Boot web application by organizing controllers, services, repositories, entities, dtos, exceptions, mappers, config, util, and security packages.
Create a PostRepository by extending JpaRepository for the Post JPA entity. Use findByEmail queries; Spring Data auto-generates SQL with Hibernate and keeps methods transactional by default.
Create a PostDto class to transfer data between the controller and view in a Spring MVC app, using Lombok for boilerplate reduction, and prepare for mapping with PostMapper.
Create a PostMapper to convert between Post entity and PostDto, using static methods mapToPostDto and mapToPost with a builder pattern to map id, title, content, shortDescription, createdOn, updatedOn, and url.
Create a service layer for the list posts feature by implementing PostService and PostServiceImpl, retrieving all posts via PostRepository and mapping them to PostDto.
Create a Spring MVC controller that injects PostService, handles get /admin/posts by calling findAllPosts, adds a posts list (PostDto) to the model, and returns the admin/posts Thymeleaf view.
Create a thymeleaf template to display a list of blog posts in a bootstrap table, using th:each and a status variable to number rows and show title, description, created on.
Adds a Bootstrap header and dark navigation bar with a posts link to the Thymeleaf blog page, and includes a fixed footer for a complete layout.
Explore creating header, navbar, and footer as Thymeleaf fragments and including them across pages with insert and replace, reducing repetition in a Spring Boot 3 blog app.
Implement the admin create post feature in a Spring Boot 3 Thymeleaf app by building the post form, mapping /admin/posts/newpost, and saving posts to the database.
Add a new post link in the header and implement a PostController handler for /admin/posts/newpost that prepares a PostDto with Lombok constructors, adds it to the model, and returns admin/create_post.
Add Spring Boot starter validation for bean validation with Hibernate Validator, annotate post fields with @NotEmpty, enable @Valid in the handler with BindingResult, and display custom error messages.
Develop the admin edit post feature by adding an edit button, creating a PostController handler and a Thymeleaf form to edit and submit posts, and saving updates to the database.
Create an updatePost handler to process edit post form submission. Map PostDto to a post entity via PostMapper, save via repository, validate with @Valid, and redirect to /admin/posts on success.
Learn to build a Thymeleaf view_post page in Spring Boot 3, assembling header, navbar, and footer fragments and displaying a post title, short description, and content from the model.
Develop search for blog posts by adding a JPQL query in PostRepository to search by title or shortDescription, map results to PostDto via PostService, and expose them at /admin/posts/search.
Implement the frontend for the search blog post feature by adding a Bootstrap-styled search bar above the posts table, wiring a Thymeleaf form to /admin/posts/search using a query parameter.
Refactor the user interface by formatting the post createdOn date with temporals.format in Thymeleaf and make the footer text visible by setting its color to white.
In this course, you will learn how to build a real-time complete blog application step by step using Spring Boot 3, Spring MVC, Thymeleaf, Spring Security 6, Spring Data JPA, and MySQL database.
In this course, we will be using Spring Boot 3, Spring Framework 6, Spring Security 6 (no deprecated APIs/classes), and Thymeleaf 3 - The latest versions as of now.
I have added a Thymeleaf crash course with 20+ lectures so if you are new to Thymeleaf then first watch the Thymeleaf crash course and then build a Blog application.
Note: This is the project development course so you need to have a basic understanding of Spring Boot, Spring Security, Spring Data JPA, and MySQL database
What you will learn?
- Learn to build a web application using a real-time industry standard approach using Spring boot 3 and Thymeleaf.
- Learn to build a complete blog full-stack web application - Spring Boot MVC for backend and Thymeleaf for Frontend.
- Learn how to use Spring MVC to build a web application
- Learn how to use Thymeleaf attributes, layouts, form handling, standard expressions, etc
- Learn Form and Bean Validations using Hibernate Validator
- Learn how to use Bootstrap CSS 5 Framework for styling web pages.
- Learn how to connect Spring boot application with MySQL database
- Learn how to use three-layer architecture - controller, service, and repository/DAO layers.
- Learn how to create JPA entities for a Blog application
- Learn how to create Spring Data JPA repositories for JPA Entities
- Learn how to secure Web applications using Spring Security
- Learn how to use Spring Security's Authentication and Authorization
- Learn how to implement Registration, Login, and Logout features
- Learn to implement Filter/Search Feature
- Learn to create a custom Mapper to convert Entity to DTO and vice versa
What is Spring Boot?
Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.
Spring Boot is an opinionated framework that helps developers build Spring-based applications quickly and easily. The main goal of Spring Boot is to quickly create Spring-based applications without requiring developers to write the same boilerplate configuration again and again.
What is Thymeleaf?
Thymeleaf is a modern server-side Java template engine for both web and standalone environments, capable of processing HTML, XML, JavaScript, CSS, and even plain text.
The main goal of Thymeleaf is to provide an elegant and highly-maintainable way of creating templates.
It's commonly used to generate HTML views for web applications.
Thymeleaf is a very popular choice for building UI so we will be using Thymeleaf to build the view layer in the Spring MVC web application (Blog App).
Technologies and Tools Used:
- Java 17
- Spring Boot 3
- Spring Framework 6
- Spring MVC 6
- Thymeleaf
- Bootstrap CSS 5 Framework
- Spring Security 6
- Spring Data JPA
- Hibernate Framework 6
- MySQL Database
- Maven
- IntelliJ IDEA
- AWS
Sample amazing feedback from students on this course:
Dhirendra Singh:
"Ramesh is always a NICE teacher."
Stefan Petkov:
"Very well structured course. Understandable and well explained the basic concepts in Spring Framework and Thymeleaf. Good job Ramesh!"
Tuan Anh Do:
"Great course, the instructor is also enthusiastic to answer, some practical problems have been solved in the lesson"
Adnan Alasow:
"The instructor effectively communicates in a clear and simplified manner that enables a beginner such as myself to comprehend the material."
Devin Berkani:
"Ramesh is simply the best instructor around when it comes to all things Java and Spring. The course was structured in such a way that I was able to complete a full-fledged CRUD application by the end of it and actually understand WHY it works as opposed to just mindlessly typing code alongside someone in a video (which was unfortunately my experience with many other Udemy courses before I found Ramesh). I feel more confident and comfortable with Spring Boot than I ever thought I could after such a short amount of time. One of the things that impressed me the most was how quick Ramesh was with his responses. Whenever I had a question, he was there to answer it in a timely manner. I felt like I was his only student, even though there were probably hundreds of others in the class. I am so grateful for Ramesh's expertise and can't wait to start his REST API course next! This course deserves more than a 5-star rating, but that's all I can give, so that's what it gets."
FRANCISCO ERICK CARMONA GARCIA:
"This course teaches you all related to Thymelead plus Spring boot security, how to create project well structured, practical CSS Bootstrap, Relational Database, JPA. Explanation is clear from the instructor."
Check out all the reviews/ratings for this course in the Reviews section of this course.