Author name: Ramesh Fadatare

Building Web Application using Spring Boot

Introduction In this chapter, we will build a web application using Spring Boot and Thymeleaf. We will create a Student Management System project to demonstrate the integration of Thymeleaf with Spring Boot, and we will explain Spring Boot auto-configuration for Thymeleaf. This chapter will guide you through setting up the project, configuring Thymeleaf, and building …

Building Web Application using Spring Boot Read More »

Spring Boot Exception Handling

Introduction In this chapter, we will learn about exception handling in Spring Boot 3.2 by building a Library Management System from scratch. We will cover how to set up the project, configure the H2 database, create entities and repositories, handle custom exceptions, and implement global exception handling using the @RestControllerAdvice annotation.

Spring Boot MySQL CRUD Operations: Setup the Spring Boot Project

Introduction In this section of the chapters, we will build CRUD REST APIs for a Student Management System Project with a MySQL database. We will create and set up a Spring Boot project in IntelliJ IDEA, using a three-layer architecture. We will configure the MySQL database, create a Student JPA entity, and a repository to …

Spring Boot MySQL CRUD Operations: Setup the Spring Boot Project Read More »

Spring Boot Project Package Structure

Introduction In this chapter, we will explore the recommended package structure for a Spring Boot project. A well-organized package structure is crucial for maintaining the readability, manageability, and scalability of your application. We will use a typical Spring Boot project structure to illustrate the concepts. Table of Contents Introduction Standard Package Structure Explanation of Each …

Spring Boot Project Package Structure Read More »

Spring Boot DELETE REST API – @DeleteMapping Annotation

Introduction In this chapter, we will cover the @DeleteMapping annotation in Spring Boot. The @DeleteMapping annotation is used to handle HTTP DELETE requests, which are typically used for deleting existing resources. We will create endpoints to delete resources using this annotation, focusing on the Employee entity as our primary example. Understanding @DeleteMapping Annotation What is …

Spring Boot DELETE REST API – @DeleteMapping Annotation Read More »

Spring Boot PUT REST API – @PutMapping Annotation

Introduction In this chapter, we will cover the @PutMapping annotation in Spring Boot. The @PutMapping annotation is used to handle HTTP PUT requests, which are typically used to update existing resources. We will create endpoints to update resources using this annotation, focusing on the Employee entity as our primary example. Understanding @PutMapping Annotation What is …

Spring Boot PUT REST API – @PutMapping Annotation Read More »

Spring Boot POST REST API – @PostMapping and @RequestBody

Introduction In this chapter, we will cover the @PostMapping and @RequestBody annotations in Spring Boot. The @PostMapping annotation is used to handle HTTP POST requests, while the @RequestBody annotation is used to bind the request body to a method parameter. We will create endpoints to create resources using these annotations, focusing on the Employee entity …

Spring Boot POST REST API – @PostMapping and @RequestBody Read More »

Spring Boot GET REST API – @GetMapping Annotation

Introduction In this chapter, we will cover everything about the @GetMapping annotation in Spring Boot. @GetMapping Annotation Overview What is @GetMapping? The @GetMapping annotation in Spring Boot is used to create a mapping between HTTP GET requests and handler methods in a controller. It is a specialized version of the @RequestMapping annotation that is specifically …

Spring Boot GET REST API – @GetMapping Annotation Read More »

Spring Boot REST API with Request Param – @RequestParam Annotation

Introduction In this chapter, we will explore how to create a Spring Boot REST API that uses the @RequestParam annotation to handle query parameters. Query parameters are a common way to pass data to REST endpoints, especially for filtering, sorting, or paginating results. We will continue from the previous chapters and extend our StudentController to …

Spring Boot REST API with Request Param – @RequestParam Annotation Read More »

Spring Boot REST API with Path Variable – @PathVariable

Introduction This chapter will continue from the previous chapter, where we created a Spring Boot REST API that returns a list of Java Beans as JSON. We will now learn how to use the @PathVariable annotation to create a REST API that can accept and handle path variables. @PathVariable Annotation Overview What is @PathVariable? The …

Spring Boot REST API with Path Variable – @PathVariable Read More »

Spring Boot REST API Returns Java Bean (JSON)

Introduction In this chapter, we will build the Spring Boot REST API that returns a Java Bean in JSON format. This is a common requirement for building web services that return the JSON to the client. Setting Up the Project Using Spring Initializr Open Spring Initializr: Navigate to Spring Initializr in your web browser. Configure …

Spring Boot REST API Returns Java Bean (JSON) Read More »

Running Spring Boot App from Command Line

Introduction In this chapter, we will learn how to run the Spring Boot application from the command line. Running your application from the command line can be useful for testing, deployment, and automation purposes. Prerequisites Before you can run your Spring Boot application from the command line, ensure that you have the following installed and …

Running Spring Boot App from Command Line Read More »

Spring Boot Thymeleaf Hello World Example

Introduction In this chapter, we will create a simple “Hello World” web application using Spring Boot and Thymeleaf. Thymeleaf is a popular templating engine for Java applications, especially for web applications. It integrates seamlessly with Spring Boot to produce dynamic web pages. Tools and Technologies Used Java 21 Spring Boot 3.2 Thymeleaf IntelliJ IDEA Maven …

Spring Boot Thymeleaf Hello World Example Read More »

Spring Boot @SpringBootApplication Annotation

Introduction In this chapter, we will explore the @SpringBootApplication annotation. This annotation simplifies the configuration of Spring Boot applications by combining several annotations into one, making the setup process easier. The class annotated with @SpringBootApplication is the main entry point of a Spring Boot application, and the execution starts from this class. What is @SpringBootApplication? …

Spring Boot @SpringBootApplication Annotation Read More »

Scroll to Top