Frameworks

Request Body

The request body is the data a client sends inside a POST or PUT request, usually as JSON. @RequestBody tells Spring to read that JSON and convert it into a Java object automatically, using the Jackson library (this is called deserialization). It is used for sending structured data such as registration forms, orders, or profile […]

Request Body Read More »

Query Parameters

Query parameters are key=value pairs added to the end of a URL after ? and joined with &, like /students/search?name=ravi&department=CSE. In a controller, @RequestParam reads each one and passes it into the method, converting it to the parameter’s type. They are used for optional search, filtering, sorting, and paging, where the URL still points to

Query Parameters Read More »

Path Variables

A path variable is a value written inside the URL itself, such as the 5 in /students/5. In the mapping you write a placeholder like /students/{id}, and @PathVariable captures the real value and passes it into the controller method. It is used to identify a specific resource (one student, one order, one course) in clean,

Path Variables Read More »

Request Mapping

Request mapping tells Spring which controller method should handle which request, based on the URL and the HTTP method. @RequestMapping on a class sets the base URL, and @GetMapping, @PostMapping, @PutMapping, @DeleteMapping on methods narrow it down. It is used so one URL like /api/students can do different things (read, create, update, delete) depending on

Request Mapping Read More »

Controllers

A controller is the class that receives HTTP requests from clients, decides what to do with them, and returns a response. Spring maps each URL and HTTP method (GET, POST, PUT, DELETE) to a controller method using annotations like @GetMapping and @PostMapping. It is used to keep the web layer separate: the controller only handles

Controllers Read More »

Spring MVC Basics

Spring MVC is the web framework in Spring Boot that follows the Model-View-Controller pattern: the Controller handles requests, the Model carries data, and the View renders the page. Every request first reaches the DispatcherServlet, which finds the right controller method, runs it, and then picks a view to render. It is used to build web

Spring MVC Basics Read More »

Spring Boot Web Development With MySQL

Spring Boot Web Development With MySQL covers how a Spring Boot web application connects to, manages, and interacts with a relational MySQL database. It bridges web layers (like REST APIs) with persistent storage by providing automated database connection pooling, query execution tools, data-to-object transformation, and multi-source data architectures. 1. Database Connectivity and SQL Operations Database

Spring Boot Web Development With MySQL Read More »

Multiple Bean Selection

When several beans implement the same interface, Spring cannot decide which one to inject and fails with a “NoUniqueBeanDefinitionException”. You resolve it with @Primary (the default choice), @Qualifier(“beanName”) (an explicit choice), or by injecting all the beans as a Map or List. It is used when one feature has several implementations, such as Email and

Multiple Bean Selection Read More »

Component Scanning

Component scanning is how Spring automatically discovers classes annotated with @Component (and its specializations) and registers them as beans, with no XML or manual @Bean needed. @SpringBootApplication includes @ComponentScan, which scans the package of the main class and all its sub-packages. It is used so you can just annotate a class and have it become

Component Scanning Read More »

Scroll to Top