
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.
Follow how Spring MVC processes an HTTP request from the dispatcher servlet to HTML output, using a handler mapper, controller, model, logical view name, view resolver, and the view component.
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.
Explore how the Thymeleaf engine, a modern server-side template processor, parses HTML templates. Use model data from the Spring MVC controller to replace expressions and attributes, producing the final HTML.
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.
Create a thymeleaf hello world example with a spring mvc controller, add 'Hello World!' to the model, and render it in a thymeleaf template using th:text.
Explore Thymeleaf variable expressions to bind model data to templates and access user attributes such as name, email, role, and gender using ${user.name} syntax in a Spring Boot blog app.
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.
Learn how the th:text Thymeleaf attribute evaluates variable, selection, and message expressions and prints the result as the host tag body, with a dummy fallback like hello good morning.
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.
Explore how Thymeleaf's th:each handles iteration with a status variable, utilizing properties like count, index, size, even, odd, first, and last to render dynamic serial numbers.
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.
Learn to render content conditionally in thymeleaf using th:switch and th:case, demonstrated with a user role example and a default case in a spring boot 3 blog app.
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.
Demonstrates a Spring MVC handler for the user registration page using Thymeleaf attributes th:action, th:object, and th:field; builds a UserForm, provides a professions list, and returns the register-form view.
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.
Submit the user registration form via @PostMapping to /register/save, bind the form data with @ModelAttribute, and display it on a register-success Thymeleaf page.
Create a spring boot project via start.spring.io (maven, java 17, spring boot 3 milestone), then import it into IntelliJ and review spring web and thymeleaf dependencies.
Add a Lombok dependency to the pom.xml file and install the Lombok plugin in IntelliJ IDEA. Enable annotation processing and restart IntelliJ to test Lombok getters and setters.
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 the myblogapp database and connect your spring boot 3 thymeleaf app by configuring application.properties with the MySQL url, username, password, and Hibernate dialect MySQL8Dialect, plus ddl-auto update.
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 blog post JPA entity with Lombok, map to posts table, define id, title, url, content, short description, createdOn, updatedOn, and apply creation/update timestamps and Lob annotation for content.
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.
Implement the admin list posts feature by building a post service with findAllPosts (using the post repository), a post controller for /admin/posts, and a Thymeleaf template to display posts.
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.
Design a Thymeleaf create post form for a blog app, building a create_post template with title, description, and content fields bound to postDto, submitting to /admin/posts, using header and footer.
Handle form submission in the post controller with @ModelAttribute, map PostDto to a Post with PostMapper, save via PostRepository, generate a URL from the title, and redirect to /admin/posts.
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.
Integrate jQuery and CKEditor 5 into a Thymeleaf create post form, replacing the textarea with a classic editor for headers, bold, links, images, and videos in Spring Boot 3.
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.
Add an edit button in the posts actions column and build a handler to fetch a post by id, map it to a dto, and populate the admin/edit_post form.
Design a Thymeleaf edit post template and form, using hidden fields for id, url, and createdDate, binding fields with th:field to populate and update blog posts.
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.
Implement delete post feature in the admin panel by adding a delete button in the actions column, wiring a handler to process the request and redirect to posts list.
Add a view button in the admin actions column, create a handler to process view post requests and return a model and view, then design the view post page.
Add a view button in actions column and implement a viewPost handler that fetches a post by URL, maps to PostDto, adds it to the model, and returns admin/view_post view.
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.
Implement a search blog posts feature in the admin area by adding a search bar to the blog posts list, enabling keyword-based filtering end-to-end across back end and front end.
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.