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...