Перейти к содержимому

Learn Spring Boot 4 by Examining Practical Applications (Part 3)

Wisest Dev

0:00 / 0:00

Learn Spring Boot 4 by Examining Practical Applications (Part 3)

84 просмотра · 13 дней назад
Wisest Dev
1 подписчик
84 просмотра · 13 дней назад
Never trust user input. In this video, you'll learn how to validate form data in a Spring Boot application with Jakarta Bean Validation and Hibernate Validator. Bad input is rejected with clear, friendly error messages instead of ugly stack traces. You'll see why input validation matters for security (OWASP Top 10), what Java Specification Requests (JSRs) are, and how to use annotations like @NotBlank, @Min, @Max, @Digits, @Past and @Email. You'll also learn to write custom validation logic and move error messages into messages.properties. As a bonus, Spring Boot DevTools reloads your app automatically when you change code. 📂 Code examples (project A03-validate-form-input, solution in solution-a03): https://github.com/wisest-dev/wisest-... ◀️ Part 1 – Your First Spring Boot App:    • Learn Spring Boot 4 by Examining Practical...   ◀️ Part 2 – Spring MVC & Thymeleaf:    • Learn Spring Boot 4 by Examining Practical...   🎓 Full course on Udemy: https://www.udemy.com/course/learn-sp... CHAPTERS 00:00 Introduction – What This Section Covers 00:51 Why Input Validation Matters: OWASP Top 10 & Injection Attacks 02:52 What Are Java Specification Requests (JSRs)? 03:49 JSR-380 Bean Validation & Hibernate Validator 06:16 Code Walkthrough: Thymeleaf Form, Controller, @Valid & BindingResult 13:17 Moving Error Messages into messages.properties 14:41 application.yml vs. application.properties 15:29 Running the App & Triggering Validation Errors 21:31 Validating Dates: @DateTimeFormat, @Past & Custom Validation 26:21 Hands-On Exercise: Email Validation & Number Format Errors 28:33 How I Solved It: @Email & @NumberFormat 33:27 Bonus: Automatic Restarts with Spring Boot DevTools 36:01 Recap WHAT YOU'LL LEARN ✅ Why weak input validation leads to injection vulnerabilities ✅ How JSRs shape the Java platform, and how Bean Validation relates to Hibernate Validator ✅ How to validate a form with @Valid and standard annotations (@NotBlank, @NotNull, @PositiveOrZero, @Max, @Digits, @Past, @Email) ✅ How to show validation errors next to each form field with Thymeleaf ✅ How to add your own validation logic with BindingResult and FieldError ✅ How to keep error messages in messages.properties, with parameters and ready for translation ✅ How to replace ugly type-conversion errors with friendly messages (typeMismatch) ✅ How Spring Boot DevTools restarts your app automatically when code changes #SpringBoot #Java #BeanValidation #HibernateValidator #JavaTutorial