Spring Boot
@RequestMapping Vs @GetMapping
π 1. @RequestMapping β General-purpose annotation to map any HTTP method (GET, POST, etc.) @RequestMapping(value = "/hello", method = RequestMethod.GET)public String sayHello() {Β Β return "Hello!";} π Syntax: @RequestMapping(value =...
@RequestMapping Vs @GetMapping
π 1. @RequestMapping β General-purpose annotation to map any HTTP method (GET, POST, etc.) @RequestMapping(value = "/hello", method = RequestMethod.GET)public String sayHello() {Β Β return "Hello!";} π Syntax: @RequestMapping(value =...
@Controller Vs @RestController
π @Controller β Purpose: Used to serve web pages (like JSP/Thymeleaf/HTML) β it returns views. π¦ Common Use Case: @Controllerpublic class ViewController {Β Β @GetMapping("/hello")Β Β public String hello(Model model)...
@Controller Vs @RestController
π @Controller β Purpose: Used to serve web pages (like JSP/Thymeleaf/HTML) β it returns views. π¦ Common Use Case: @Controllerpublic class ViewController {Β Β @GetMapping("/hello")Β Β public String hello(Model model)...
π What is a Spring Boot Starter?
AΒ Spring Boot Starter is a pre-configured set of libraries that provides the functionality for a particular use case β like web apps, data access, security, etc. β Starters follow the...
π What is a Spring Boot Starter?
AΒ Spring Boot Starter is a pre-configured set of libraries that provides the functionality for a particular use case β like web apps, data access, security, etc. β Starters follow the...
π¦ What is MultipartFile?
MultipartFile is an interface provided by Spring to represent an uploaded file received in a multipart/form-data request. It allows you to read, store, or manipulate uploaded files in memory or...
π¦ What is MultipartFile?
MultipartFile is an interface provided by Spring to represent an uploaded file received in a multipart/form-data request. It allows you to read, store, or manipulate uploaded files in memory or...
Spring Boot REST API : Upload & Download files
π¦ Tech Stack Spring Boot Spring Web (REST) Multipart support (MultipartFile) File System for storage π 1. Maven Dependencies (pom.xml) <dependency>Β Β <groupId>org.springframework.boot</groupId>Β Β <artifactId>spring-boot-starter-web</artifactId></dependency> π οΈ 2. Controller Class β...
Spring Boot REST API : Upload & Download files
π¦ Tech Stack Spring Boot Spring Web (REST) Multipart support (MultipartFile) File System for storage π 1. Maven Dependencies (pom.xml) <dependency>Β Β <groupId>org.springframework.boot</groupId>Β Β <artifactId>spring-boot-starter-web</artifactId></dependency> π οΈ 2. Controller Class β...
REST API Fallback mechanism!
Handling API calls when the client or server is down requires planning for resilience, retries, and fallback mechanisms. Hereβs how to approach it: β 1. Clarify Who is Down Scenario...
REST API Fallback mechanism!
Handling API calls when the client or server is down requires planning for resilience, retries, and fallback mechanisms. Hereβs how to approach it: β 1. Clarify Who is Down Scenario...