
Learn to build Java applications with Spring Boot and Hibernate, develop a REST API and a Spring MVC app, and connect to databases for CRUD with Maven and Java configuration.
Verify your Java development environment by installing JDK 17 or higher and a Java IDE, preferably IntelliJ community edition, and run a Hello World app to prepare for Spring Boot.
Discover how Spring Boot simplifies Spring development with auto configuration and an embedded server, enabling standalone jars or traditional war deployments.
Demonstrates using the spring initializer at start.spring.io to generate a maven web project with an embedded tomcat, then import the project into your IDE and rely on Maven for dependencies.
Create a simple rest controller in Spring Boot that exposes a / endpoint returning 'Hello World', then run the app to see the response.
Discover spring projects as optional add-ons to the core framework, including Spring Cloud, Spring Data, Spring Batch, Spring Security, Spring Web Services, and Spring LDAP; explore them on spring.io.
Learn how Maven manages build and dependencies for Spring Boot, using start.spring.io to generate Maven projects, and handling the pom.xml, Maven Central repository, local repository, and starters.
Explore the standard Maven directory structure: src/main/java, resources, webapp, src/test, and target, and understand how pom.xml configures the project.
Discover Maven key concepts by examining the POM file, project metadata, dependencies, and plugins. Learn how group id, artifact id, and version form coordinates to fetch dependencies from Maven Central.
Explore the Spring Boot project structure, including source/main/java and resources, and the Maven wrapper, then see how the POM uses starters and the Spring Boot plugin to package and run.
Configure spring boot by editing application.properties in src/main/resources, adding coach.name and team.name, read them in a rest controller with @Value, and load static resources and templates from their directories.
Discover how Spring Boot starters provide a curated set of Maven dependencies, offering a one-stop solution for web, security, and data features with compatible versions.
Learn how the spring boot starter parent provides maven defaults, java version control, and utf eight encoding, while enabling dependency inheritance and easy plugin setup.
Enable automatic restarts for Spring Boot apps by adding the spring-boot-devtools dependency to your pom.xml, and configure IntelliJ community edition to build projects automatically.
Enable Spring Boot dev tools for automatic reloading and configure IntelliJ, then add the devtools dependency in pom.xml to support live updates and expose /workout and /fortune endpoints.
Discover how Spring Boot Actuator exposes ready-to-use endpoints for health, info, and metrics, enabling monitoring and management with no extra code.
Learn to enable Spring Boot actuator endpoints, expose health and info, configure via application.properties, and verify /actuator/health and /actuator/info in a running Spring Boot project.
Explore Spring Boot actuator endpoints such as /info, beans, thread dump, and mappings, and learn to expose endpoints and read formatted JSON for debugging.
Secure spring boot actuator endpoints with spring security, using spring-boot-starter-security; login prompts for /beans with a generated password, customize credentials in application.properties, and exclude /health and /info.
Secure Spring Boot actuator endpoints by adding Spring Security, using the default user and generated password shown in logs, and excluding health and info endpoints.
Run Spring Boot apps from the command line by packaging as a self-contained jar and launching with java -jar or mvnw spring-boot:run, without an IDE.
Delete actuator and security dependencies from the pom.xml, then prepare to run Spring Boot apps from the command line, with OS-specific steps covered in separate videos.
Learn to run a Spring Boot app from the command line on Windows, package with mvnw, run the jar or use spring-boot:run, and verify endpoints like /, /workout, and /fortune.
Learn to run spring boot apps from the command line on macOS or Linux, packaging with mvnw, and running via java -jar or the spring boot maven plugin.
Define custom properties in the application.properties file and inject them into a Spring Boot app using the @Value annotation, pulling coach.name and team.name into a rest controller.
Learn how to define custom properties in Spring Boot using application.properties, inject them with @Value, and expose them via a simple /teaminfo endpoint returning coach name and team name.
Configure Spring Boot using the application.properties file, learning web, security, data, and actuator properties. Set server port, context path, logging levels, actuator endpoints, and data sources to tailor your app.
Configure the Spring Boot server port to 7070 and set the application context path to /mycoolapp, then restart and verify teaminfo, workout, and fortune endpoints under the prefixed URL.
Explore inversion of control with a Spring container as an object factory, creating and managing objects, configuring it with Java annotations or source code to inject dependencies and swap coaches.
Explore Spring dependency injection by applying the dependency inversion principle; learn how the Spring container creates and injects required dependencies, using constructor and setter injection, and autowiring with component scanning.
Define the dependency interface and class, mark CricketCoach as a Spring bean, and expose /dailyworkout returning 'Practice fast bowling for 15 minutes' via constructor injection.
Boot a Spring Boot project via Spring Initializr on start.spring.io, configure Maven and Java, add DevTools and Spring Web, generate, unzip, and import into IntelliJ for constructor injection coding.
Define a coach interface and a cricket coach, annotate the class as a spring bean, and inject it via a constructor in a rest controller to expose /dailyworkout.
Learn why the IDE shows 'no usages' for Spring beans like CricketCoach, and how runtime bean injection occurs behind the scenes, letting you disregard the warning.
Understand constructor injection in Spring, how it wires a cricket coach into the demo controller behind the scenes and enables REST APIs.
Explore how Spring Boot uses component scanning to auto-register beans from the main package and sub-packages, and how base package configuration controls scanning.
Move controllers into rest and common packages to leverage Spring Boot's default component scanning, verify via /dailyworkout, and resolve a ConfigurationClassParser error by rebuilding after stale code.
Explicitly set base packages for Spring Boot component scanning, including com.luv2code.util, to ensure injections when moving packages and verify data via the endpoint.
Explore setter injection in Spring, wiring dependencies with @Autowired on setter methods, illustrated by a cricket coach example, and learn when to use setter versus constructor injection for optional dependencies.
Learn setter injection in Spring Boot by applying the Autowired annotation to a setter method in the demo controller and verify at localhost:8080/dailyworkout.
Explore how field injection works with the Autowired annotation, why Spring favors constructor and setter injection, and why field injection is discouraged for testability, with a quick legacy example.
Explore annotation autowiring and qualifiers to resolve ambiguity when multiple coach implementations exist in Spring, using qualifier to specify cricket coach for constructor or setter injection.
Implement multiple coach classes with constructor injection and component annotations to illustrate qualifiers, returning daily workouts: baseball 30 minutes batting practice; tennis backhand volley; track 5k run.
Resolve bean ambiguity with the qualifier annotation to select baseball, track, or cricket coach; the demo shows dailyworkout returning baseball and switching coaches via configuration.
Resolve multiple coach implementations using the primary annotation or the qualifier annotation for a coach. Compare primary and qualifier annotation, note the single primary constraint, and recommend qualifier for precision.
Resolve bean ambiguity in Spring by using the @Primary annotation to designate a default bean when multiple implementations exist, with hands-on debugging and testing.
Learn how lazy initialization defers bean creation in Spring Boot, enabling beans only when needed. Explore enabling global lazy initialization with spring.main.lazy-initialization=true and understand its trade-offs.
Implement lazy initialization in a Spring Boot application by using qualifier annotations, removing primary, and adding constructor diagnostics to observe bean creation and startup behavior.
Mark the track coach as lazy and enable global lazy initialization with spring.main.lazy-initialization=true, so beans are created on demand and only initialize when needed.
Discover bean scopes in Spring Boot, including the default singleton and prototype lifecycles, plus web scopes like request, session, application, and websocket, with a /check example.
Demonstrate bean scopes by contrasting singleton and prototype in a spring boot demo, showing how prototype creates a new instance per injection while singleton reuses the same bean.
Understand the bean lifecycle in Spring, from instantiation and dependency injection to custom init and destroy hooks using PostConstruct and PreDestroy annotations.
Define and test bean lifecycle methods using @PostConstruct and @PreDestroy, switch to singleton scope, and verify startup and cleanup in a practical Spring Boot example.
Configure spring beans with java code using a configuration class and @Bean, inject a swim coach into a controller, and illustrate exposing a third-party service such as AWS S3.
Create a java-config bean SwimCoach, remove @PostConstruct and @PreDestroy, and demonstrate constructor diagnostics in a demo controller, illustrating the crash caused by the missing component annotation and constructor parameter.
Create a SportConfig class in a config package, annotate with @Configuration, expose SwimCoach via @Bean named swimCoach, inject into the controller, and use aquatic bean id for daily workout endpoint.
Explore how Hibernate and JPA enable object-to-relational mapping to persist and retrieve Java objects with annotations and entityManager, and understand the benefits of a standard, portable ORM API.
Discover how Hibernate and JPA use JDBC for all database communications, acting as an abstraction layer above JDBC.
Set up the MySQL development environment by installing the database server and Workbench, learn to create schemas and tables, and execute CRUD operations for your Spring Boot projects.
Set up the database by using two starter sql scripts to create a MySQL user and a student table with id, first_name, last_name, and email.
Set up a MySQL database for a Spring Boot Hibernate JPA project. Create the student_tracker schema and student table with id, first name, last name, and email.
Set up a Spring Boot project with Spring Initializr, using the MySQL driver and Spring Data JPA, enabled by data source configuration and the EntityManager from the Jakarta Persistence API.
Initialize a Spring Boot project via start.spring.io with Maven and Java, add the MySQL driver and Spring Data JPA, generate and import into the IDE.
Configure the application properties with spring data source url, username, and password to connect to student tracker database, then run the app to verify the connection and see hello world.
Map a Java entity class to a database table using JPA annotations like @Entity and @Table, map fields with @Column, and cover GenerationType.IDENTITY and the no-arg constructor requirement.
Define a Student entity mapped to the student table with @Entity and @Table, using @Id and @GeneratedValue(strategy = GenerationType.IDENTITY) for id, mapping first_name, last_name, and email, constructors, getters, setters, and toString.
Create a CRUD student app using a data access object with a JPA EntityManager managed by Spring Boot, outlining save, find, update, and delete operations and the role of JpaRepository.
Define the student DAO interface and its implementation, inject the entity manager, and persist the student within a Spring transaction. Update the main app to save and display the id.
Define the StudentDAO interface and its save method, then implement StudentDAOImpl with a repository annotation, constructor-injected entity manager, and transactional support to persist the student.
Inject the StudentDAO into the main application, create and save a student object, and display the generated id, then verify the new record in MySQL Workbench against the student table.
Explore the student table schema, identify the primary key id with not null and auto increment, and test creating multiple students to observe MySQL auto increment in action.
Learn how to change the MySQL auto_increment start value with ALTER TABLE, set a custom start like 3000, and reset to 1 using TRUNCATE for the student_tracker.student table.
Learn how to read objects with JPA using entityManager.find by primary key. Implement a DAO method fineById, handle nulls for missing records, and retrieve the student in the main application.
Implement a new DAO method findById to read a student by id with the entity manager, then save, display, and retrieve the student in the command line runner.
Explore querying multiple objects with JPQL in JPA, using entity names, fields, where clauses, and named parameters. Implement DAO methods to fetch students and filter by last name or email.
Learn to query objects with JPA by implementing a DAO findAll method using a TypedQuery for Student entities, and sort results by last name in asc or desc.
Learn to query objects with JPA by adding a findByLastName method using JPQL with named parameters, omitting the order by clause, and verify results against a database.
Learn how to update single and multiple JPA entities by locating with entityManager.find, mutating via setters, merging changes, and executing updates with executeUpdate to return updated row counts.
Update a student in a spring boot app using jpa by adding a dao update method, applying transactional annotation, and merging changes with entityManager.merge after findbyId.
Delete a single student with entityManager.find and entityManager.remove, or delete multiple with delete from student where lastName = Smith, and track rows affected with executeUpdate while wiring the DAO methods.
Learn to implement a delete operation in a JPA DAO by fetching the entity with entityManager.find, wrapping the process in a transaction, and removing it with entityManager.remove.
Add a deleteAll method to the student DAO and use a transactional entity manager to execute 'delete from student' and return the affected row count.
Discover how Hibernate can automatically generate and apply database tables from Java code with JPA annotations, using create, create-drop, validate, or updates.
Enable Hibernate SQL logging at debug and trace levels in application.properties. Create multiple students, observe inserts and IDs, then drop the student table.
Configure spring.jpa.hibernate.ddlauto to auto create database tables from Java source using JPA and Hibernate. See how drop-and-create vs update preserves or replaces data with sample student records.
Learn to build REST APIs and web services with Spring, using JSON over HTTP, and create a weather client that consumes an external weather service via @RestController.
Explore rest apis and rest services with practical examples like a currency converter, movie tickets, and a crm service that returns json data to diverse apps.
Learn JSON basics, including syntax and data types, numbers, strings, booleans, nested objects, and arrays, plus name-value pairs in plain text and language-independent data exchange.
Learn rest http basics and how http methods map to create, read, update, and delete. Explore request and response messages, status codes, mime types, and using postman for testing.
Explore Postman basics by sending a get request to the jsonplaceholder users endpoint, inspecting the json response, status 200, and headers, and preview future put, post, and delete crud operations.
Learn to build a Spring rest controller with @RestController and @GetMapping, create a /test/hello endpoint that returns Hello World, and test it using browser or Postman.
Learn to develop a Spring Boot REST service by adding the Spring Boot Starter Web Maven dependency, creating a @RestController, and mapping a hello endpoint with @GetMapping.
Configure a Spring Boot project on start.spring.io, add web dependency, generate the project, and create a rest controller with /hello that returns hello world.
Explore how Jackson powers JSON data binding by converting JSON to a Java POJO and back using getters and setters. Learn how Spring integrates Jackson for JSON in REST controllers.
Build a Spring REST service that returns a list of students at /api/students, using a REST controller and Jackson to convert between Java POJO and JSON.
Create a simple Java POJO for a student with first name and last name, include a no-arg and all-args constructor, and generate getters and setters in the entity package.
Create a Spring REST controller with @RestController and /api base path, expose GET /students that returns a hard-coded list of student POJOs converted to JSON by Jackson.
Learn how Spring rest uses a path variable to retrieve a single student by id. Call the endpoint /api/students/{studentId}, bind with @PathVariable, and return JSON via Jackson.
Refactor a Spring Boot REST controller to load student data once using @PostConstruct, by defining a students field and moving data loading from getStudents into loadData. Verify with Postman.
Define a Spring Boot REST endpoint to retrieve a single student by id using a path variable, bind it to the method parameter, and index into the list.
Define a custom error response POJO and StudentNotFoundException, throw it for missing students, and handle with Spring's @ExceptionHandler to return a 404 JSON error with status, message, and timestamp.
Update the rest service to throw a student not found exception for invalid ids and implement an exception handler that returns a 404 JSON error via ResponseEntity.
Create a custom rest error handling in Spring Boot by building a student error response pojo with status, message, timestamp, and a student not found exception, with constructors and getters.
Update the rest controller to throw a student not found exception for invalid IDs. Add an exception handler with @ExceptionHandler to return a 404 JSON error response.
Demonstrates testing Spring Boot REST exception handling by sending various ids and invalid inputs, confirming json error responses and status codes, and planning a generic exception handler for edge cases.
Implement a catch-all exception handler for generic exceptions in the student rest controller, return a 400 bad request with a JSON error response, and test using Postman.
Enable global rest exception handling using controller advice to centralize error handling across controllers, moving exception handler logic from services to a single json response advisor.
Create a new controller advice to enable global exception handling with @ControllerAdvice; refactor the rest controller by moving exception handlers into it, and test with normal and erroneous requests.
Design a REST API by identifying the employees resource, assigning CRUD operations with HTTP methods on /api/employees, using JSON bodies, and avoiding verb-laden endpoints.
Explore real-time REST API design by examining PayPal, GitHub, and Salesforce examples, and apply CRUD patterns with invoices and repositories to a CRM application, noting path parameters and path variables.
Build a Spring Boot REST API for an employee directory, perform CRUD with post, get, put, delete, and connect to a database via controller, service, and DAO.
Download and unzip employee.sql from Resources, place it in dev-spring-boot/04-spring-boot-rest-crud, then run the script in MySQL Workbench to create employee_directory and an employee table with id, first_name, last_name, and email.
Create a Spring Boot REST project with Spring Initializer, include Web, JPA, Dev Tools, and MySQL driver; generate, unzip, and import into IDE for a Crud demo app.
Create a spring boot jpa dao with the standard jpa api and an EntityManager via constructor injection. Implement the Employee entity, dao interface, and rest controller later.
Set up IntelliJ auto-build and dev tools, then configure Spring Boot data source and create an employee entity with mappings, constructors, getters, setters, and toString for a REST DAO project.
Create a DAO interface and its implementation, annotate with repository, inject an entity manager via constructor, and implement a find all method using a JPA query to return employees.
Create a Spring Boot REST controller with constructor-injected employee DAO to expose /api/employees and return all employees via a GetMapping.
Define a service layer with the Spring @Service annotation to delegate to DAOs, integrating employee, skills, and payroll data for a single controller view via the service facade pattern.
Define a service layer with EmployeeService and EmployeeServiceImpl, inject via constructor, and refactor the rest controller to delegate to the service instead of the dao.
Learn to implement a Spring Boot DAO with findById, save (merge) for insert or update, and deleteById, while applying transactional boundaries at the service layer and returning the updated entity.
Add, update, and delete employee records using a dao with find by id, save, and delete by id, backed by an entity manager and service-layer transactions.
Add methods for find by id, save, and delete by id to employee service, copying from DAO and delegating to it, with transactional annotation to let service layer manage transactions.
Explore Spring Boot REST controller methods to fetch a single employee by ID and to create a new employee using POST with JSON body, content-type header, and service delegation.
Postman posts json with first name, last name, and email to /api/employees, bind to an employee object, set ID to zero or null, and verify ID in MySQL Workbench.
Learn to implement update and delete operations in a Spring Boot REST controller using PUT and DELETE mappings, handling JSON with @RequestBody and testing with Postman and MySQL Workbench.
Learn to perform partial updates with PATCH in a Spring Boot REST API, contrast with PUT, update single or multiple fields via /api/employees/{id}, and improve efficiency with partial payloads.
Inject a Jackson JSON mapper into a Spring Boot REST controller, add patch mapping support, and apply partial updates to an employee while preserving the primary key.
Implement a Spring Boot REST patch endpoint to update an employee by injecting a JSON mapper, binding path and body data, validating id, and applying the patch.
Learn how to apply a patch to an in-memory employee, save it to the database via a service, and return the updated database record.
Perform partial update with a patch request in a Spring Boot REST app. Update an employee's email, verify changes in MySQL, and test ID in the request body error handling.
Learn how to implement a Spring Boot delete by employee id, using a delete mapping, @PathVariable, and service.deleteById, including not-found handling and verifying deletion with Postman and MySQL Workbench.
Explore how Spring Data JPA extends the JPA repository interface to provide automatic CRUD methods for any entity, eliminating boilerplate DAO code and enabling simple repository usage.
Refactor a spring boot rest app to use spring data jpa by creating an EmployeeRepository extends JpaRepository, replacing the old dao, and leveraging Optional for findByid while removing @Transactional.
Test and implement a Spring Boot REST API with Spring Data JPA, performing CRUD operations—get all, get by id, add, update, and delete—via Postman and a JPA repository.
Learn how Spring data rest exposes endpoints from JPA repositories in Spring Boot, reducing boilerplate and enabling create, read, update and delete operations, with hateoas, pagination, sorting, and custom queries.
Add the Spring Data REST dependency to the pom.xml to expose endpoints from JpaRepositories. Delete the employee REST controller and service, keeping only the entity, repository, and Spring Boot application.
Explore how Spring Data REST exposes CRUD endpoints with HATEOAS, customize the base path (magic-api) via application.properties, and perform create, update, and delete operations using Postman.
Discover Spring Data REST configuration, pagination, and sorting for exposed endpoints. Override pluralization with repository rest resource paths and tune base path, default and max page sizes, and property-based sorting.
Configure spring data rest endpoints by renaming the resource to members with @RepositoryRestResource(path="members"), then adjust default page size and test pagination and sorting in Postman.
Document and explore Spring Boot REST APIs with OpenAPI and Swagger using Springdoc; generate a web UI and JSON or YAML docs by inspecting endpoints.
Refresh the database with the employee SQL script to establish five baseline employees; OpenAPI/Swagger does not work with Spring Data REST in Spring Boot 4, so use REST controllers.
Run and explore your Spring Boot rest api with Swagger ui, using Spring doc to auto-generate endpoints, try get, put, delete, retrieve employees by id with json responses via curl.
Configure a custom swagger UI path with springdoc in a Spring Boot app, then view REST API documentation in JSON or YAML at localhost:8080/diversion/api-docs, enabling client generation and testing.
Configure a custom api docs path to /my-api-docs, run the app, and verify JSON and YAML OpenAPI outputs and swagger-ui access before returning to defaults.
Discover how to secure a Spring Boot REST API with authentication and role-based authorization, storing users and passwords in databases, using declarative and programmatic security.
Refresh the database and import a ready-made Spring Boot REST API project, enabling security basics, and configure Maven dev tools with DAO, entity, and service layers.
Enable spring security with the spring boot starter security dependency to secure endpoints by default and log in with the default user and generated password.
Configure a Spring Security setup with in-memory users John, Mary, and Susan, assigning roles (employee, manager, admin) and illustrate password formats using noop and bcrypt before moving to database storage.
Explore basic spring security configuration and in-memory authentication by defining John, Mary, and Susan with roles, then test basic authentication on a REST API using Postman.
Restrict rest endpoints by role using Spring Security, granting read to employee, write to manager, and delete to admin via request matchers and http basic authentication, csrf considerations noted.
Configure role-based access in Spring Boot rest api by building a security filter chain restricting /api/employees by roles for get, post, put, delete, with basic auth and CSRF disabled.
Test role-based access with postman: an employee can read but cannot add, update, or delete. Tests show 200 ok on allowed endpoints and 403 forbidden on restricted actions.
Demonstrate role-based access control in a Spring Boot REST API by restricting endpoints to employee, manager, and admin roles, with tests for get all, get one, add, update, and delete.
Learn how to resolve 403 errors on put requests with Spring Data REST by configuring security to allow the id in the URL, using DemoSecurityConfiguration.java and the /api/employees/** pattern.
Secure a Spring Boot rest api by restricting access with roles, adding patch handling for partial updates limited to managers, and updating security config to include patch for /api/employees/**.
Enable patch security in a Spring Boot REST API by enforcing the manager role for patch on /employees/**, verified with Postman tests.
Set up database-backed authentication using Spring Security's predefined JDBC schema with users and authorities tables and plain text passwords for initial setup.
Set up a plain text security database by running the 04-setup-spring-security-demo-database-plaintext.sql in MySQL Workbench, creating users and authorities tables with John, Mary, and Susan and their roles prefixed with role_.
Configure spring security to use jdbc authentication with a data source and a jdbc user details manager, replacing hard-coded users, then verify access to /api/employees via basic auth in Postman.
Demonstrates configuring Spring Security with JDBC authentication, switching from in-memory to database-driven user data, updating passwords, and enforcing role-based access control for delete operations.
Implements bcrypt password hashing with Spring Security to protect user passwords through salting and one-way hashing, using the bcrypt algorithm to resist brute-force attacks.
Modify the password column to 68 characters for bcrypt, insert users with encrypted passwords, and review JDBC authentication where input is encrypted and compared to stored values; never decrypted.
Demonstrates securing a Spring Boot REST API with bcrypt passwords by configuring the database, encoding passwords, and validating access via Postman through Spring Security.
Learn to configure Spring Security with JDBC authentication using custom tables by creating members and roles tables, then supplying user and authorities queries in the security configuration.
Run the SQL script to set up security tables, drop authorities and users, create custom members and roles, and seed John, Mary, and Susan; configure Spring Security to use them.
Refine spring security with custom tables by configuring JdbcUserDetailsManager queries for users and authorities, using select statements against members and roles, then test authentication via Postman.
Debug a SQL syntax error in the custom roles query by correcting the column name, enabling login and authority loading. Verify admin can delete and the employee is blocked.
Explore Thymeleaf, a Java templating engine for server-side rendering with Spring Boot, showing how to add Thymeleaf to Maven, wire a controller, and render HTML with th:text.
Create a Spring Initializr Maven project with Java and the latest spring boot, set group to love spring boot and artifact to thyme leaf demo, add web and dev tools.
Create a Spring Boot MVC app with a demo controller and time leaf template to display the server time via a model attribute on hello world.
Style Thymeleaf templates in Spring Boot by adding a CSS file under static, referencing it with th:href, and optionally using Bootstrap locally or via CDN.
Create a css folder under source/main/resources/static, add demo.css with italics and green, then reference it in helloworld.html via th:href and apply the 'funny' class.
Explore the behind-the-scenes of Spring MVC, where the DispatcherServlet delegates requests to the Controller, Model, and View, with Thymeleaf and other templates and flexible configuration options.
Learn to read form data with Spring MVC by displaying a hello world form, submitting the name, and showing a confirmation page that echoes the student name.
Build a HelloWorldController with showForm and processForm methods to render helloworld-form.html via Thymeleaf, and process the form submission with a get request to /processForm.
Map the hello world form with a show form endpoint, then implement a process form handler to read the student name from the form in Spring MVC.
Learn how to add and read data in the Spring model, convert form input to uppercase, and display it on the view using model attributes.
Learn to add data to a Spring MVC model by reading form parameters in a Spring Boot controller, converting to uppercase, and passing a message to the view.
Update the Spring MVC view to read the message from the model with ${message} and align the form to process form version two, display the user name on the page.
Learn how to read HTML form data with Spring MVC using @RequestParam, automatically bind request parameters to method parameters, and use the bound value (e.g., uppercase name) in the model.
Demonstrate binding form data with @RequestParam in a Spring MVC controller, reading the studentName as theName, converting it to all caps, and returning a v3 message.
Learn how @GetMapping and @PostMapping simplify Spring model-view-controller routing, with get data in url and post data in the body, and when to use each for length and file uploads.
Demonstrate GetMapping and PostMapping by showing how each handles requests, intentionally break the mapping to reveal a 405 method not allowed error, then revert to GetMapping for proper operation.
Explore how Spring Boot handles form processing with GetMapping and PostMapping, comparing GET parameters to POST body data, and debugging mapping issues with browser developer tools.
Explore Spring MVC form data binding with Thymeleaf, using a student model attribute to bind first name and last name, and submit to a controller to display the confirmation.
Create a model package with a Student class (firstName, lastName) and getters/setters, then build a Spring MVC controller to show a form and bind the Student as a model attribute.
Build an HTML form with Thymeleaf bound to a student model, using star syntax for first and last name, while Spring MVC binds and processes the form via post mapping.
Create a student confirmation page in spring mvc to display entered first and last names using form data binding, controllers, and a simple confirmation view.
Explore spring mvc form data binding with dropdown lists, using html select and Thymeleaf to send country selections via th:field and backend country property.
Create a Spring MVC form drop-down for country, bind it to the student model with th:field and th:value, display the country on confirmation, and add a getter/setter.
Inject a comma-delimited countries list from application.properties into the controller with @Value, add it to the model, and render dynamic drop-down options in Thymeleaf using th:each.
Bind the Spring MVC form with radio buttons to the student object's favorite language, submit to a controller, log the data, and display it on the confirmation page, with updates.
Learn how to bind radio button inputs in a Spring MVC form, extend the student model with a favorite language property, and display the selected language on the confirmation page.
Read a languages list from application.properties, inject it with @Value, and add it to the model. Generate dynamic radio buttons in the form and submit to display the chosen language.
Explore Spring MVC forms with check boxes for multiple selections of operating systems. Update the HTML form, student class, and confirmation page, handling spaces with single quotes.
Bind multiple check boxes to a list of favorite systems in a Spring Boot 3, Spring MVC form, and display them as a bullet list on the confirmation page.
Enhance a Spring MVC form by binding check boxes to a dynamic systems list read from application.properties via @Value, injecting into the model, and rendering with th:each for submission.
Master Spring MVC form validation using the Bean Validation API, applying @NotNull, @Min, @Max, @Size, @Pattern, @Future, and @Past, and build a custom validation rule with a Java annotation.
Set up a Spring MVC project with Spring Initializr, Maven, and the latest Spring Boot version, adding web, thymeleaf, validation, and devtools for auto reload.
Explore enforcing required fields in Spring MVC forms with null and size validations on last name, binding a customer model, and handling validation results to show errors or a confirmation.
Create a customer class with first name and last name, apply Jakarta validation to require the last name with a minimum size, and resolve IDE warnings about Jakarta annotations.
Create a new Spring MVC controller to map the root URL and display the HTML form. Use the model to bind a blank customer instance and return the customer-form view.
Create a new customer-form.html with thymeleaf bindings, linking th:action to processForm and th:object to the customer model, validating firstName and lastName with red error messages.
Validate and process form data in the controller using @Valid and @ModelAttribute, with BindingResult to capture errors, then route back to the customer form or to the confirmation page.
Build a Spring Boot MVC confirmation page that displays the customer's first and last name with Thymeleaf, and enforce required fields through not null, size, and binding results.
Learn how Spring MVC validation uses @InitBinder to pre-process requests by trimming strings with StringTrimmerEditor, converting whitespace-only inputs to null, and registering a global editor via WebDataBinder.
Implement an InitBinder to trim leading and trailing whitespace with StringTrimmerEditor, converting whitespace-only inputs to null and improving Spring MVC form validation.
Explore Spring MVC validation for number ranges with @Min and @Max by adding a free passes field to the customer class, showing errors on the form, and validating in controller.
Add and validate a freePasses field in the customer class using @min and @max, display errors on the HTML form, and confirm valid input in a Spring MVC app.
Apply Spring MVC validation with regular expressions to validate a postal code (five characters or digits) in a customer form, display errors, and update the confirmation page.
Apply Spring MVC validation with a regular expression to enforce a five-character postal code on the customer postalCode field, and display error messages on the HTML form.
Make an integer form field required via Spring MVC validation by using the @NotNull annotation and switching from int to Integer to fix string-to-int conversion issues.
Validate string input for integer fields in spring mvc by defining a custom type-mismatch message in resources/messages.properties and displaying an invalid number error to users.
Inspect the binding result to debug Spring MVC validation, override specific typeMismatch errors with custom messages, and apply insights from a messages.properties setup to your own project.
Implement a custom validation rule in Spring MVC by creating a course code annotation and constraint validator, applying it to a form field, and enforcing it starts with luv.
Define the @CourseCode annotation (value and message) for a Spring MVC field, with a validator that initializes from the annotation and checks the input starts with the configured prefix.
Create a custom CourseCode annotation for Spring MVC validation, link it to CourseCodeConstraintValidator, and apply it to fields or methods with runtime retention.
This lecture guides building a custom Spring MVC validation annotation, defining attributes value and message with defaults, and configuring groups and payloads, using LUV as the sample prefix.
Implement a CourseCodeConstraintValidator in Spring MVC validation, with initialized and isValid methods. Use annotation value to set CoursePrefix and check the code starts with it.
Add a custom courseCode validation to the customer class, apply the @CourseCode annotation, show errors on the form, and echo the entered value on the confirmation page.
Explore spring mvc validation with a custom validation annotation and a course code constraint validator, including null checks and customizing prefixes such as luv or tops.
Create a Thymeleaf CRUD web UI for an employee directory with Spring Boot, enabling list, add, update, and delete, while wiring the controller to the service, repository, database, and templates.
Download and unzip the starter rest api project, refresh the database with employee-directory.sql, and verify /api/employees returns json.
Build a Spring MVC employee controller that lists employees using an employee service and Thymeleaf view, with constructor injection, mapping /employees/list to list-employees.html.
Create a Thymeleaf list-employees.html, add the XML namespace, and display the employee model attribute with th:text to verify data from the database via the MVC controller, service, and repository.
Integrate bootstrap styles and build a dynamic employee directory table using thymeleaf, looping over employees from the database via controller, service, and repository in a spring mvc app.
Add index.html in static to redirect root to /employees/list, removing the 404. Refactor package to thymeleafdemo and rename main app, then verify localhost:8080 still works.
Add employees with Thymeleaf in a Spring Boot app: use the add button to open form, bind first name, last name, and email, then save via controller, service, and repository.
Refactor the project to use a dedicated /employees templates folder, map the controller to /employees/list-employees, and add a bootstrap-styled add button linking to /employees/showFormForAdd, validating app runs at localhost:8080.
Create and display a new employee form by configuring a get mapping, binding a model attribute, rendering the employee-form.html template with bootstrap styling, and submitting to /employees/save.
Create an add employee form with a back link, save via post mapping, prevent duplicates with post/redirect/get, and sort results using findAllByOrderLastNameAsc in Spring Data JPA.
Use thymeleaf to update an employee: click the update button in the action column, load by id to pre-populate the form, then save changes with a single save method.
Add an update button and a form pre-populated with the selected employee’s data, using an id-embedded link and a hidden field to update records in the crud database project.
Learn to delete an employee using Thymeleaf with a confirmation prompt, removing a database record and refreshing the list. Implement deletion with a controller calling deleteById and redirecting to list.
Add a delete button to the employee list, embed the employee id in the url, prompt for confirmation, then delete via the controller and service and redirect to the list.
Explore how to secure a Spring MVC web application with Spring Security, implementing authentication and authorization using users and roles, and building default or custom login forms to protect URLs.
Demonstrate role-based access with Spring MVC security by securing employee, manager, and admin pages, showing a custom login with validation and restricted links to leadership retreat and admin holiday cruise.
Create a Spring Boot web app with MVC and security, integrate Thymeleaf, and build a home page. Follow step-by-step initialization with Spring Initializer, pom.xml dependencies, and a demo controller.
Develop a Spring MVC security setup by creating a demo controller with a home route and a Thymeleaf home page, then test with the default username and password.
Learn to diagnose and fix persistent login in dev and testing by forcing new sessions through new browser windows, private/incognito mode, or restarting the browser.
Configure Spring security with an in-memory user details manager for John, Mary, and Susan, assign roles employee, manager, and admin, and show noop and bcrypt encoding.
Create a security package and DemoSecurityConfig class, configure in-memory users john, mary, and susan with passwords and roles, and verify login via the default spring security page.
Learn to implement a custom login form with spring security by configuring the security, creating a login controller, and building an html/css based login page.
Learn how to wire a custom login form to spring security's login processing URL /authenticateTheUser, with username and password fields, validated by security filters through your configured authentication manager.
Modify Spring Security configuration to use a custom login form, set up a login controller, and define login processing to authenticate users while permitting access to the login page.
Create a login controller and plain-login view in spring mvc, align it with the spring security configuration, and post credentials to /authenticateTheUser using username and password.
Test and troubleshoot our custom login form wired to Spring Security, revealing that failed logins show no error message. Prepare to add error handling in the next videos.
Create a custom login form with Spring Security and display an error message on failed login. Check the 'error' parameter in the URL to show 'invalid username and password'.
Learn how to show and test a login error message in Spring MVC security by checking the error parameter and styling it with red CSS for the login form.
Learn to design a Bootstrap login page for Spring MVC security, update the form to the login processing URL, validate username and password, and integrate a Bootstrap UI.
Implement a custom login form in Spring MVC security with Bootstrap, wire th:action to the login processing URL, and verify username and password on the fancy-login view.
learn how to add spring security logout by exposing /logout, post logout data via a form, and redirect to the login page with a logged-out message.
Configure spring security to enable logout and add a form-based /logout button on the home page. Display a logged-out message when spring security signals a logout parameter.
Learn to display the logged-in user ID and roles using Spring Security by accessing authentication principal.username and principal.authorities on your homepage.
Display the current user’s id and roles on a Spring MVC security page. Use security: authentication with principle.username and principle.authorities to show user id and role list.
Learn to restrict access by roles in spring mvc security using requestMatchers with hasRole or hasAnyRole to secure home page, leadership retreat page, and holiday cruise page (EMPLOYEE, MANAGER, ADMIN).
Practice Spring MVC security by building controller and view pages, adding homepage links to /leaders and /systems, and restricting access by roles such as employee, manager, and admin.
Develop the leaders page with a Spring MVC controller and view for the /leaders route, and prepare to restrict access based on roles so only managers can view it.
Restrict urls by roles in Spring MVC Security, securing root, leaders, and systems paths with employee, manager, and admin roles, and fix typos to ensure proper access.
Implement role-based access in Spring MVC security by restricting /systems to admin users, updating the controller and view, and validating access for admin vs employee logins.
Configure a custom access denied page in Spring MVC by setting exceptionHandling .accessDeniedPage with a request mapping path. Create the supporting controller and view, and customize HTML, CSS, and bootstrap.
Configure a custom access denied page in Spring MVC by updating the security config and adding a dedicated access-denied get mapping with a corresponding view.
Create and test a custom access denied page in Spring MVC security, with a tailored message and homepage link, then verify role-based restrictions by logging in as an employee.
Display content based on user roles using Spring Security tags to show manager or admin content only to authorized users.
Learn to implement role-based content display in Spring MVC using the sec:authorize tag. Restrict sections to users with MANAGER or ADMIN roles by applying hasRole checks, then test the changes.
Test the app by logging in as different users to display content based on roles. Verify employees cannot see manager or admin content; managers and admins access respective sections.
Learn to configure Spring Security with database-stored users using JDBC authentication, leveraging Spring's default users and authorities schemas, and move from hard-coded accounts to database-driven authentication.
Set up a Spring MVC security demo with JDBC authentication using plain text passwords, create users and authorities tables, populate sample users, and visualize the database schema.
Add maven dependencies for spring boot data jpa and mysql-connector-j, configure jdbc connection in application.properties to a local employee_directory schema, and enable runtime-scoped jdbc logging for dev and testing only.
Switches Spring Security to JDBC authentication by replacing hard-coded users with a user details manager bean that uses the auto configured data source and the users and roles tables.
Verify JDBC authentication and authorization in a Spring MVC app by querying a MySQL database with prepared statements for user credentials and authorities.
Learn how Spring Security uses bcrypt to hash passwords, adds a random salt to thwart brute force, and see a quick demo for generating bcrypt passwords and seeding user accounts.
Configure bcrypt-encrypted passwords in a Spring Security JDBC setup by updating the password column to 68 characters, inserting hashed users, and understanding the login flow through security filters.
Learn how to implement JDBC authentication in Spring MVC security using bcrypt encrypted passwords, set up a users and authorities table, and verify login with Spring Security.
Configure Spring Security to use JDBC authentication with custom tables. Provide queries to find a user by username and to find roles by username, and create members and roles tables.
Configure spring mvc security with jdbc authentication on custom tables named members and roles, seeding John, Mary, and Susan via sql script 06 set up spring security custom table names.
Configure Spring Security to use jdbc user details manager with custom tables by defining queries for user by username and for authorities, then verify login with John as employee.
Explore Hibernate advanced mappings, including one-to-one, one-to-many, many-to-one, and many-to-many. Model real-world relationships like instructors with profiles, courses, and students.
Learn primary keys and foreign keys, cascading and cascading delete, eager vs lazy loading, and unidirectional and bidirectional JPA mappings across instructor, details, courses, and students.
Learn Hibernate one-to-one mapping with a unidirectional instructor and detail setup, using foreign keys, SQL scripts, and step-by-step modeling.
Map instructor and instructor detail with a one-to-one relationship in Hibernate using @OneToOne and a join column, and understand cascade types and the entity lifecycle.
Examine 1-to-1 mappings and cascade types: persist, remove, refresh, detach, merge, and all, and see how the owning side and the entity manager persist the instructor and its detail.
Set up a one-to-one mapping by creating the instructor and instructor_detail tables, add a foreign key on instructor.instructor_detail_id referencing instructor_detail.id, and configure the hb-01-one-to-one-uni schema.
Create a Spring Boot 3 project with Maven, add MySQL driver and Spring Data JPA, generate, unzip, import into IntelliJ, and set up command line runner that prints hello world.
Configure application.properties with datasource url, username, and password to establish the database connection and run the standalone app with the spring boot banner off and warnings only, showing hello world.
Create the InstructorDetail entity in the entity package, map it to the instructor_detail table, annotate id, youtube_channel, and hobby with JPA, and generate constructors, getters, setters, and a toString.
Create the instructor entity and map it to the instructor table with a one-to-one relationship to instructor_detail using @OneToOne and @JoinColumn, plus cascade all, constructors, getters, setters, and toString.
Define AppDAO with a save(Instructor) method, implement AppDAOImpl using a constructor-injected entity manager, and use @Transactional to persist instructor and cascade to instructor detail.
Implement a one-to-one mapping by creating an instructor and its detail, inject the app DAO with a bean, and save using cascade all, while logging Hibernate SQL.
Run the Spring Boot app, fix a bean error by annotating AppDAO for component scanning, and demonstrate one-to-one mapping by saving InstructorDetail first, then Instructor, with Madhu Patel's guitar hobby.
Learn to implement one-to-one mapping to find an instructor by id using entityManager.find, with eager fetch of instructor and details in a Spring Boot and Hibernate setup.
Execute a one-to-one delete by id with a DAO method deleteInstructorById. Retrieve the instructor using entityManager.find, then remove it with entityManager.remove, cascading to instructor details via CascadeType.ALL.
Implement bidirectional one-to-one mapping between instructor and instructor detail using mappedBy and cascade, and load detail to access its instructor without changing the schema.
Implement a bidirectional one-to-one mapping by adding an instructor field, getters and setters, and @OneToOne annotation with mappedBy and CascadeType.ALL in InstructorDetail; copy the uni project for the bi version.
Update the DAO interface and implementation to add find instructor detail by ID, and demonstrate a bidirectional one-to-one retrieval of an instructor detail and its instructor in the main app.
Implement a bi-directional one-to-one mapping with cascade delete by deleting an instructor detail by id and cascading to the associated instructor, with a transactional data access object and verification.
Configure a bidirectional one-to-one mapping to delete the instructor detail without removing the instructor by adjusting cascade types and breaking the bidirectional link, then verify the result in the database.
Explore Hibernate one-to-many bidirectional mappings between instructors and courses, implement many-to-one associations with a join column, enforce unique course titles, tailor cascade types excluding remove, and integrate the main application.
Establish a bidirectional one-to-many relationship between instructor and courses using the mapped by instructor mapping. Implement add course to maintain bidirectional links and apply selective cascade (persist, merge, detach, refresh).
Create the hb-03-one-to-many schema in mysql workbench, add the course table with id, title, and instructor_id, enforce a unique title, and define the foreign key to instructor.
Create a course entity mapped to the course table, with id, title, and an instructor reference, including constructors, getters, setters, and a toString method for JPA mapping.
Annotate the course entity by mapping id and title to columns, establish a many-to-one relationship to the instructor with a join column, and apply selective cascades (persist, merge, detach, refresh).
Implement a one-to-many relationship between instructor and course using a java.util.list, with mapped by instructor and without cascading deletes. Add a bidirectional helper method to synchronize instructor and course references.
update the application.properties to hb-03-one-to-many, then implement create instructor with courses in command line runner, copying existing instructor code and setting Susan Public's details and video games hobby.
Create courses and attach them to an instructor in a one-to-many relationship, then save with cascade persist to the database.
Compare eager and lazy fetch types in Hibernate, using examples of instructors with courses and courses with students, and learn why lazy loading improves performance by loading data on demand.
Master one-to-many fetch types, employing lazy loading for master views and eager loading for detail, while handling open Hibernate sessions and common lazy-loading pitfalls.
Demonstrate fetching an instructor's courses with a OneToMany relation by switching from lazy to eager fetch, diagnosing a lazy initialization error, and verifying loaded courses (Air guitar, The Pinball Masterclass).
Learn to implement lazy loading for a one-to-many relationship by switching the fetch type to lazy. Write a findCoursesByInstructorId query and associate courses with an instructor.
Learn to use lazy fetch for one-to-many relationships, and implement findCoursesByInstructorId with a TypedQuery and EntityManager to retrieve courses by instructor id.
Implement a OneToMany lazy loading flow by retrieving courses for an instructor with findCoursesForInstructor and findCoursesByInstructorId, then associate them via setCourses and verify success.
Learn how to use join fetch with a one-to-many relationship to retrieve an instructor and their courses in one query, preserving lazy loading and offering flexible fetch options.
Add a findInstructorByidJoinFetch method to fetch an instructor and their courses in a one-to-many relation using JOIN FETCH, mirroring eager loading.
Master efficient data access by using join fetch to retrieve an instructor and their courses, then extend the fetch to include instructor_detail, reducing multiple queries to a single query.
Use a OneToMany update: find the instructor by ID, update data with setters, and persist changes via a DAO using entityManager.merge in a transactional update.
Update a course in a one-to-many setup by finding it by id, updating its title with setters, and persisting the change through a DAO update using entityManager.merge.
Delete an instructor in a one-to-many relationship by first breaking the association with all courses, then removing the instructor to avoid foreign key constraint violations.
Delete a course using a new DAO method deleteCourseById with @Transactional, find with entityManager.find, then remove with entityManager.remove, and verify deletion in the database.
Implement a unidirectional one-to-many relationship between course and reviews in Hibernate, map with a join column and cascade all, and enable lazy loading.
Set up a one-to-many uni database by running the hb-04-one-to-many-uni script in MySQL Workbench, creating a review table with id, comment, and course_id, and linking to course.id.
Create a uni-directional one-to-many review entity and map it to the review table, defining id and comment fields with constructors, getters, setters, and toString, plus JPA annotations.
Refactor the course entity to create a uni-directional one-to-many relationship with reviews, using lazy loading, cascade all, a reviews list, and a join column as course id.
Implement a uni-directional one-to-many relationship in Spring Boot with a new dao save method and transactional main app updates, persisting a course and its reviews via cascade all.
Develop a uni-directional one-to-many fetch by implementing a DAO method to retrieve a course and its reviews using join fetch, then print the results in a test run.
Implement deletion of a course and its associated reviews via cascade all, using appDAO.deleteCourseById in the CommandLineRunner; verify removal in MySQL Workbench.
Explore how to implement a many-to-many relationship between courses and students using a join table, course_student, with composite primary key and foreign keys to course and student tables.
Learn to map a many-to-many relationship between courses and students with @ManyToMany and @JoinTable, using join columns, inverse side, owning side, and mappedBy to link the course_student join table.
Set up the hb-05-many-to-many schema and create the course_students join table with course_id and student_id as a composite primary key, using MySQL Workbench and reverse engineering for many-to-many Hibernate mappings.
Back up the project, clean the CruddemoApplication and CommandLineRunner by removing commented code, and update application.properties to point to the new database schema.
Map the student class to the student table with @Entity and @Table, define id, firstName, lastName, and email, and set up @Id, @GeneratedValue(IDENTITY), constructors, getters, setters, and toString.
Map the course-student many-to-many in Hibernate by adding a students list with getters, setters, and an addStudent method, and configure the join table course_student with course_id and student_id.
Map a student to courses using a many-to-many bidirectional relationship in JPA/Hibernate, with an addCourse method, a course list in student, and a mapped-by join table for consistent persistence.
Create a Pacman course and two students, add the students to the course, and persist the course with cascading saves to the associated students via a many-to-many relationship.
Add a new DAO method to find a course and its students by course id using a join fetch, then execute the query and print the results.
Implement a DAO method findStudentAndCoursesByStudentId to fetch a student and their courses using a join fetch on s.courses, then execute and print the loaded student and enrolled courses.
Enhance a student in a many-to-many setup by adding more courses through a transactional update method using entityManager.merge, persisting new courses and updating the course_student join table.
Delete a course in a many-to-many setup by removing its join table associations without deleting students, using the existing delete method and confirming Pacman course ID 10.
Delete a student by id in a many-to-many setup, first removing the student's associations from all courses, then deleting the student via the entity manager within a transactional method.
Review advanced mappings with a cheat sheet focusing on one-to-one, one-to-many, and many-to-many, including owning and inverse sides, foreign keys, and join tables to adapt to your domain.
Explore aspect oriented programming with a basic account controller, service, and dao, and apply aop to inject logging and security checks before method execution, then extend across layers.
Explore how aspect-oriented programming addresses code tangling and scattering by encapsulating logging and security as reusable aspects, then apply them to account and product controllers via configuration.
Explain how the proxy pattern enables aspect-oriented programming with logging, security, and transactions behind the scenes. Define configurable aspects and apply them selectively to reduce code tangling, noting runtime costs.
Explore aspect-oriented programming basics—aspect, advice, join points, and pointcuts—and compare Spring AOP’s runtime weaving with proxies to AspectJ’s full weaving options and join points coverage.
Spring AOP provides a simple, proxy-based, method-level solution with easy migration to AspectJ via @Aspect annotations, while AspectJ delivers full AOP across all join points and faster performance.
Explore aspect-oriented programming with @Before advice to run code before a method, enabling logging, security, and transactions. See how the application calls AccountDAO.addAccount and how a before advice monitors interaction.
Spring boot auto enables AOP via the starter; implement a before advice with an aspect for the account dao. Show how the before advice runs before add account.
Set up a Spring Boot 3 AOP project, add the AOP starter manually in pom.xml, configure logging and banner in application.properties, and run a command-line runner to print hello world.
Define the AccountDAO interface and AccountDAOImpl, annotate with @Repository, and wire the DAO into a Spring Boot app via @Bean in CommandLineRunner to illustrate a before-advice setup.
Create a logging aspect using @Aspect and @Component, define a @Before advice for any execution of public void addAccount, and print a log before the method runs.
Run the demo app to see a before advice in an aspect execute before addAccount, as the aspect monitors calls and explains narrowing and widening pointcut expressions with wildcards.
Explore aspect-oriented programming pointcut expressions in Spring, focusing on execution pointcuts, optional patterns, and wildcards to match methods by modifiers, return type, declaring type, name, parameters, and throws.
Apply before advice to the addAccount method across classes with a pointcut expression, verify matches in a demo app, then switch to updateAccount and revert.
Apply AOP pointcut expressions, part 2, to match any addAccount method across classes. Inject the new MembershipDAO, call addAccount, and observe the advice fire for both AccountDAO and MembershipDAO.
Learn to create a super-specific pointcut expression in AOP that targets only AccountDAO.addAccount by using the fully qualified class name, excluding MembershipDAO.
Write code to match methods starting with add in any class using pointcut expressions and wildcards. Demonstrate @Before advice on addAccount and addSilly methods in AccountDAO and MembershipDAO.
Learn to match methods by return type in aspect-oriented programming with pointcut expressions, using void and any return type patterns, and verify how advice runs on method execution.
Explore AOP pointcut expressions and learn to match methods by parameters using wildcard patterns, including zero to many arguments and specific argument types, with package scope examples.
Match methods by account parameter types using a pointcut expression and update the logging aspect. Create an Account class and pass an Account object to AccountDAO.addAccount to demonstrate parameter-type matching.
Learn to use aop pointcut expressions to match methods with an account parameter and additional parameters, and adopt a dot-dot wildcard to accept any parameter count.
Learn how AOP pointcut expressions match methods with any parameters, then narrow wildcards to the com.luv2code package to prevent conflicts and ensure reliable bean exposure in Spring Boot.
Apply aspect-oriented programming by using a pointcut expression to match all methods in a given package, enabling after advice across multiple DAOs and methods.
Identify how to declare and reuse pointcut expressions using the @Pointcut annotation, applying a single declaration to multiple advices. Explore the benefits of updating in one place and sharing pointcuts.
Create a pointcut declaration and apply it to advice in an AOP workflow, demonstrating matching methods in the DAO package and preparing for reuse across multiple advices.
Reuse a single pointcut declaration to apply before advices for multiple methods, enabling API analytics across DAO calls.
Explore how to combine pointcut expressions in AOP to apply advice to a package while excluding getters and setters, using and, or, and not with pointcut declarations.
Learn to declare and combine pointcuts in AOP, apply them to advice, and test with getter and setter methods in a DAO, preparing to exclude them.
Apply aspect-oriented programming with combined pointcuts to exclude getters and setters. Target dao package methods and apply advices for adding accounts and api analytics.
Learn to control the order of aspects in Spring AOP by refactoring advices into separate aspects and using @Order to guarantee lower numbers have precedence.
refactor by splitting advices into api analytics and log to cloud async aspects, then use @ order to control execution order and run the app.
Learn to refactor by moving advices into separate aspects and sharing pointcut expressions via a common luv aop expressions class, making pointcuts public and reusable across api analytics and cloud aspects.
Enable Spring AOP debug logs to diagnose missing pointcuts and ensure configuration by assigning @Order values 1, 2, and 3 to cloud log async, demo logging, and API analytics aspects.
Learn how to read method arguments with join points in AOP, displaying the method signature and each argument using JoinPoint and MethodSignature for runtime logging.
Read method arguments with JoinPoint objects in AOP to log data and display the method signature.
Master aop logging by capturing method arguments with join points, iterating and printing each arg, and downcasting account args to reveal name and level for clearer traces.
Advance your understanding of aop by exploring before, after returning, after throwing, after, and around advice with working code examples, alongside pointcut expressions and joinpoints.
Discover how the @AfterReturning advice in AOP runs after a successful method execution, enabling post processing of the return value for logging, security, and transactions.
Demonstrates building an application using after returning advice to log outcomes, by adding constructors to the Account class and a findAccounts method to AccountDAO, with sample accounts.
Apply after returning advice in a Spring Boot app by calling accountDAO.findAccounts, printing the retrieved accounts, and preparing for future AOP logging in the main program.
Add an @AfterReturning advice to AccountDAO.findAccounts in the logging aspect to log the method and its returned results, demonstrating how AOP prints the account list after successful execution.
Learn how after returning advice in aspect-oriented programming post-processes and modifies return values, formatting or enriching result data like account lists before they reach the caller.
Learn how to use after-returning advice in AOP to post-process and modify method return data, converting account names to uppercase after AccountDAO.findAccounts.
Learn how after throwing advice handles exceptions in AOP by logging and auditing them, potentially notifying DevOps, and understanding exception propagation and pointcut usage.
Demonstrate aop's @afterthrowing advice by simulating exceptions in the account dao with a tripwire boolean, using a try catch around find accounts, and printing the caught exception.
Implement an @AfterThrowing advice in Spring AOP, configure pointcut and exception parameters, and log exceptions within the findAccounts method for robust error handling.
Discover the @After advice in aspect-oriented programming, which runs after a method completes, regardless of outcome, like a finally block. Use cases include logging, auditing, and resource cleanup.
Implement the @After advice in a logging aspect to run after a method, regardless of outcome. Test exception and success cases by using a tripwire and observing after advice behavior.
Explore how around advice in AOP enables before and after execution, using proceeding join points to time methods, log results, and handle exceptions in a FortuneService example.
Create the TrafficFortuneService interface and its TrafficFortuneServiceImpl in the com.luv2code.aopdemo.service package, annotate the class with @Service, and implement getFortune with a five‑second delay using TimeUnit.SECONDS.sleep. Wrap the delay in a try/catch and prepare to add the @Around advice for the AOP demonstration.
Explore around advice in spring's aspect-oriented programming by instrumenting the getFortune method with a proceeding join point, timing its execution, and printing the fortune result in the demo app.
Use around advice to print the target method with ProceedingJointPoint.getSignature and getShortString, start a begin timestamp, call proceed, then compute end timestamp and print the duration in seconds.
Handle exceptions with around advice by wrapping the proceeding join point in a try-catch, logging the error, and returning a default fortune to callers via the AOP proxy.
Add a tripWire to simulate an exception and modify the @Around advice to handle it, wiring the Get Fortune flow through the Traffic Fortune Service interface and implementation.
Modify around advice to catch exceptions from getFortune, log the error, and return a user-friendly message, while measuring duration in nanoseconds.
Explore around advice in aspect-oriented programming by rethrowing exceptions after logging them. See how the around advice logs errors and rethrows to the proxy, letting the calling program decide handling.
Add a logging aspect to a Spring MVC CRUD app, using the Spring Boot AOP starter, with before and after returning advice for controller, service, and DAO.
Download the existing Spring MVC CRUD project, set up in a Spring Boot environment, refresh the employee directory database with an sql script, and prepare to integrate AOP.
Add the Spring Boot starter aop dependency in pom.xml and reload. Create an aspect package with a demo logging aspect annotated with @Aspect and @Component, and configure a logger.
Explore AOP with Spring MVC by building pointcut expressions for controller, service, and DAO packages and using @Before advice to log methods and arguments in a CRUD app.
Learn how AOP integrates with a Spring MVC CRUD app by using before advice to display method arguments with joinPoint.getArgs and logger.info, tracing update flows to save and list employees.
Implement afterReturning advice for the logging aspect in a Spring MVC crud app, using a forAppFlow pointcut and logging the returned data from repository, service, and controller.
UPDATED FOR SPRING BOOT 4 AND SPRING 7
POPULAR IDE - IntelliJ (free version)
#1 BEST SELLING SPRING BOOT & HIBERNATE COURSE ON UDEMY - 440,000+ STUDENTS ENROLLED
THIS COURSE HAS THE #1 STUDENT ENROLLMENT OF ANY SPRING BOOT COURSE ON UDEMY!
OVER 92,000 REVIEWS - 5 STARS!
THIS COURSE COVERS SPRING BOOT 4 AND SPRING 7
LEARN these HOT TOPICS in Spring Boot 4 and Spring 7:
Spring Boot 4
Spring Framework 7
Spring Boot 4 REST API
Spring Boot 4 Core
Spring Boot 4 Annotations
Spring Boot 4 Java Configuration (all Java, no xml)
Spring Boot 4 and Spring MVC
Spring Boot 4 Hibernate/JPA CRUD
Spring Boot 4 Security
Spring Boot OpenAPI and Swagger
Maven
REAL-TIME PROJECTS
Spring Boot 4 REST API (with full database CRUD real-time project)
Spring Boot 4 REST API + OpenAPI and Swagger (with full database CRUD real-time project)
Spring Boot 4 REST API Security (with password encryption in the database)
Spring Boot 4 with JPA and Spring Data JPA (with full database CRUD real-time project)
Spring Boot 4 with Spring Data REST (with full database CRUD real-time project)
Spring Boot 4 with Spring MVC, Thymeleaf (with full database CRUD real-time project)
Spring Boot 4 Spring MVC Security (with password encryption in the database)
COURSE UPDATES
Updated course to SPRING BOOT 4 and SPRING 7
This course covers the LATEST VERSIONS of Spring Boot 4, Spring 7 and Hibernate 7!
Build a complete Spring Boot REST API + Hibernate/JPA CRUD app ... all from scratch! (real-time project)
You will learn about: Spring Boot Core, Spring Boot MVC, Spring Boot Security, Spring Boot REST API, Spring Data JPA, Spring Data REST, Thymeleaf, AOP and Hibernate/JPA ... all connected to a MySQL database
By the end of this course, you will create all of the source code for a complete Spring Boot REST APIs for a full CRUD REST API real-time project.
You will also develop a Spring Boot MVC - Hibernate/JPA CRUD real-time project.
You will type in every line of code with me in the videos ... all from scratch.
I explain every line of code that we create. So this isn't a copy/paste exercise, you will have a full understanding of the code.
I am a RESPONSIVE INSTRUCTOR . Post your questions and I will RESPOND in 24 hours.
Join 440,000+ students that are already enrolled!
Over 92,000+ Reviews! (the most reviews for any Spring Boot & Hibernate course on Udemy, 3x the nearest competitor)
=
Sample of the reviews:
Best Spring Boot course by far across all learning platforms for me. Best course structure and instructor always demonstrates in depth knowledge by covering the necessary basics. Really really incredible good presentation and structure, a lot of other instructors can learn a lot from you Chad. - Muzi P.
I worked in some company, so I can say that this course is 100% industry oriented. The best course for learning Spring Framework. Getting replies within 24 hours. - Premang
I'm adding to my review following Chad's recent updates to his course to cover Spring Boot, JPA, etc. After finishing the course originally, I found another Spring Boot class, and after working on this other class, I appreciate more what Chad has done here. He's made Spring Boot for CRUD applications with Thymeleaf very easy to follow and learn. I've taken half a dozen other software courses, and while other instructors might be good, Chad is the gold standard here. I can't recommend him highly enough. - Dave Zeltserman
This is the best tutorial I've seen so far for Spring/Hibernate, each step is well explained and the tutorial videos are made to a high standard. I highly recommend this course! - Rob
Hats off to you Chad, the best Spring fundamentals course I have done on Udemy thus far. You never disappoint. - Morebodi Modise
Chad is an excellent natural teacher. His course is well organized. He makes difficult concepts very easy to understand. - Julie Hodgson
=
Live Coding - I code all of the real-time projects from scratch
All source code is available for download
Responsive Instructor - All questions answered within 24 hours
=
PDFs of all lectures are available for download
Closed-Captions / Subtitles available for English and other languages (new!)
Professional video and audio recordings (check the free previews)
=
What Is Spring Boot?
Spring Boot is the modern development approach for building enterprise application. Spring Boot minimizes the configuration required for setting up Spring projects. By using Spring Boot, you can accelerate your development speed and leverage the auto-configuration features. This course covers the latest version of Spring Boot 4.
What Is Spring?
Spring is an enterprise Java framework. It was designed to simplify Jakarta EE development and make developers more productive. Spring makes use of Inversion of Control and Dependency Injection to promote good software coding practices and speed up development time. This course covers the latest version of Spring 7.
This course covers Spring Core, Annotations, All Java Spring Configuration, Spring AOP, Spring MVC, Spring Security, Spring REST, Spring Boot and Spring Data JPA.
What Is Hibernate/JPA?
Hibernate/JPA is an Object-to-Relational-Mapping (ORM) framework. It simplifies database access for Java applications. By using the framework, you can easily store and retrieve Java objects by setting up some simple configuration mappings.
This course covers basic Hibernate/JPA CRUD. Also, advanced Hibernate/JPA mappings are covered for one-to-one, one-to-many and many-to-many.
Benefits of Taking This Spring Boot and Hibernate Course
Knowing Spring Boot and Hibernate can get you a job or improve the one you have. It's a skill that will put you more in demand in the enterprise Java industry, and make your software life easier, that's why it's so popular.
Nearly every job posting asks for skills in Spring Boot and Hibernate!
This course will help you quickly get up to speed with Spring Boot and Hibernate. I will demystify the technology and help you understand the essential concepts to build a real Spring Boot and Hibernate application from scratch.
You Will Learn How To
Spring Boot
What is Spring Boot?
Creating a Project with Spring Boot Initializr
Develop a REST API Controller with Spring Boot
Explore the Spring Boot Project Structure
Leverage Spring Boot Starters - A Curated List of Dependencies
Inherit Defaults with Spring Boot Starter Parents
Automatically Restart with Spring Boot Dev Tools
Add DevOps functionality with Spring Boot Actuator Endpoints
Secure Spring Boot Actuator Endpoints
Run Spring Boot apps from the Command-Line
Use the Spring Boot Maven Plugin to package and run Spring Boot apps
Inject custom application properties into a Spring Boot REST Controller
Maven
Simplify your build process with Maven
Create Maven POM files and add dependencies
Run Maven builds from the IDE
Use Maven during the development of Real-Time Projects for Spring Boot MVC, Spring Boot Security, Spring Boot REST API and Hibernate/JPA
Spring Core
Build a complete Spring MVC and Hibernate/JPA CRUD Project ... all from scratch
Set up your Spring Boot and Hibernate/JPA
Wire beans together in the Spring container using Inversion of Control
Configure the Spring container for Dependency Injection
Define Spring Beans using the Component annotation
Perform auto-scanning of Spring beans to minimize configuration
Automatically wire beans together using Autowired annotation
Apply all Java configuration to Spring Beans (no xml)
Spring REST APIs
Overview of REST APIs
Investigating Spring Boot REST support
Sending JSON data over HTTP
JSON Data Binding with the Jackson project
Converting JSON data to Java POJO with Jackson
Developing a Spring Boot REST API
Setting up a Spring Boot REST project with Maven
Creating the Spring Boot REST Controller using RestController
Running the Spring Boot REST Controller with the IDE
Testing Spring Boot REST Web Services with Postman
Parameterize Spring Boot REST API endpoints using PathVariable
Add Spring Boot REST exception handling with ExceptionHandler
Integrate global Spring Boot REST exception handling with ControllerAdvice
Leverage ResponseEntity for fine-grained control of Spring Boot REST HTTP response
Build Spring Boot REST API to execute CRUD actions on the Database with Hibernate/JPA
Create a Real-Time Project using Spring Boot REST API with full database CRUD
Spring REST API CRUD
Develop a REST API Controller with Spring Boot with full CRUD support
Configure Spring Boot Data Source for MySQL Database
Create DAO implementations using JPA Entity Manager
Apply Best Practices by integrating a Service Layer
Expose REST API endpoints in Controller code (GET, POST, PUT and DELETE)
Access the REST API using Postman
Spring Boot and Spring Data JPA
Minimize boilerplate code with Spring Data JPA and the JpaRepository
Refactor existing REST API to integrate with Spring Data JPA
Leverage new features of the the Java Optional pattern with JpaRepository
Test the Spring Data JPA repository with Postman
Spring Boot and Spring Data REST
Accelerate your development process with Spring Data REST
Leverage Spring Data REST to eliminate custom code for controllers and service
Automatically expose REST endpoints for your JPA Repositories
Customize REST base path endpoints
Apply pagination and sorting to REST API endpoints
Configure default page sizes for REST APIs
Investigate HATEOAS compliant REST responses
Test Spring Data REST with Postman
Spring Security
Secure your REST APIs and web applications with Spring Boot Security
Set up your Maven pom.xml file with Spring Boot Security starter
Configure Spring Boot Security with all Java configuration (no xml)
Create custom Spring Boot Security login pages with Bootstrap CSS
Add logout support using default features of Spring Boot Security
Leverage Spring Boot Security support for Cross Site Request Forgery (CSRF)
Define users and roles for authentication
Display user login info and role using Spring Boot Security tags
Restrict access to URLs based on user role
Hide and Display content based on user role
Add JDBC authentication, store user accounts and passwords in the database
Store encrypted passwords in the database using bcrypt
Register new users and encrypt passwords using Java code
Create a Spring Security Real-Time Project using authorization, authentication and database encryption
Spring MVC
Set up your Spring Boot MVC environment with configs and directories
Create controllers using Controller annotation
Read HTML form data using RequestParam
Leverage Spring Boot MVC model to transport data between controller and view page
Define Request Mappings for GET and POST requests
Minimize coding with Spring Boot MVC Form data binding
Leverage Thymeleaf expressions to access data from the Spring Boot MVC Model
Apply CSS stylesheets to your Thymeleaf templates
Spring MVC Validation
Create a Spring MVC Validation project using the Spring Initializr website
Apply validation rules for required fields, number ranges and regular expressions
Leverage the InitBinder and StringTrimmerEditor to trim white spaces
Configure error messages using the messages properties file
Develop a custom validation rule using annotations
Spring Boot and Thymeleaf
Develop view templates with Thymeleaf in Spring Boot projects
Examine the auto-configuration of Thymeleaf in Spring Boot projects
Create a Spring Boot project with Thymeleaf using the Spring Initializer website
Develop a Spring Boot MVC Controller and a Thymeleaf template
Spring Boot, Thymeleaf and Database CRUD
Develop a real-time project with Thymeleaf and Spring Boot with full database CRUD support
Integrate the Repository to execute CRUD actions on the Database with Spring Data JPA
Apply best practices with the Service layer design pattern
Create a Controller to handle web browser requests
Develop Thymeleaf templates to render database results
Beautify your Thymeleaf templates with Bootstrap CSS
AOP: Aspect Oriented Programming
Set up a Spring Boot project for AOP
Apply AOP concepts: Aspects, advices and pointcut expressions
Add logging messages using the Before advice
Define pointcut expressions to match on parameters, return types and packages
Create reusable pointcut expressions
Combine pointcut expressions using logical operators
Control the execution order of aspects using Order
Access method execution metadata using JoinPoints
Leverage JoinPoints to read method arguments
Apply an AfterReturning advice to post-process the data
Integrate AfterThrowing advice to access exceptions
Develop an AOP Advice using Around to pre-process and post-process method calls
Integrate AOP into a Spring MVC CRUD app
Compared to other Spring Boot/Hibernate courses
This course is fully up to date and covers the latest versions of Spring Boot 4, Spring 7 and Hibernate 7. The course also includes new content on Spring Boot 4, Spring Data JPA, Spring Data REST and Thymeleaf.
Beware of other Udemy Spring/Hibernate courses. Most of them are outdated and use old versions of Spring and Hibernate. Don’t waste your time or money on learning outdated technology.
Also, I create all of the code from scratch in this course. Beware of other courses, those instructors simply copy/paste from their github repo or they use pre-written code. Their approach is not ideal for real-time learning.
Take my course where I show you how to create all of the code from scratch. You can type the code along with me in the videos, which is the best way to learn.
I am a very responsive instructor and I am available to answer your questions and help you work through any problems.
Finally, all source code is provided with the course along with setup instructions.
Student Reviews Prove This Course's Worth
Those who have reviewed the course have pointed out that the instruction is clear and easy to follow, as well as thorough and highly informative.
Many students had also taken other Spring Boot and Hibernate courses in the past, only to find that this Spring Boot and Hibernate course was their favorite. They enjoyed the structure of the content and the high quality audio/video.
Sample of the Student Reviews:
Best Spring Boot course by far across all learning platforms for me. Best course structure and instructor always demonstrates in depth knowledge by covering the necessary basics. Really really incredible good presentation and structure, a lot of other instructors can learn a lot from you Chad. - Muzi P.
I worked in some company, so I can say that this course is 100% industry oriented. The best course for learning Spring Framework. Getting replies within 24 hours. - Premang
Chad Darby has done a superb job organizing this course, and has made Spring Framework, MVC, AOP, Hibernate, Security easy to learn and use. I have a bs and ms in CS, have been developing software for 25 years, and have taken many courses over the years at the different companies I've been at and Chad is easily the best instructor I've had. - Dave Zeltserman
This is the best tutorial I've seen so far for Spring/Hibernate, each step is well explained and the tutorial videos are made to a high standard. I highly recommend this course! - Rob
Hats off to you Chad, the best Spring fundamentals course I have done on Udemy thus far. You never disappoint. - Morebodi Modise
Chad is an excellent natural teacher. His course is well organized. He makes difficult concepts very easy to understand. - Julie Hodgson
Quality Material
You will receive a quality course, with solid technical material and excellent audio and video production.
My courses have received rave 5 star reviews and over 900,000 students have taken the courses. Also, these courses are the most popular courses in their respective categories.
Similar thing for this Spring Boot course, it is ranked as #1 best seller for Spring courses.
I also have an active YouTube channel where I post regular videos. In the past year, I’ve created over 300 video tutorials (public and private). My YouTube channel has over 6.8 million views and 40k subscribers. So I understand what works and what doesn’t work for creating video tutorials.
No Risk – Udemy Refund
Finally, there is no risk. You can preview 25% of the course for free. Once you purchase the course, if for some reason you are not happy with the course, Udemy offers a 30-day refund (based on Udemy's Refund Policy).
So you have nothing to lose, sign up for this course and learn how to build Spring Boot and Hibernate Real-Time Projects from scratch!
Target Audience
Java Developers with basic Java experience