Filter
Exclude
Time range
-
Near
Day 5 - Spring Boot Explored how Spring Boot handles client requests using RequestParam, PathVariable and RequestBody. Built APIs like /user?id=1, /user/1, and handled POST requests with JSON data. #SpringBoot #Java #BackendDevelopment
1
1
7
110
🚀 Spring Boot Annotations You MUST Know – With Real-World Use Cases Spring Boot annotations are not just shortcuts, they define how your application starts, scales, secures, and behaves in production. 🔹 Application Bootstrapping: @SpringBootApplication → Entry point of the app; enables auto-configuration, component scanning, and Spring Boot defaults @EnableAutoConfiguration → Lets Spring configure beans based on classpath dependencies @ComponentScan → Automatically discovers and registers components in specified packages 🔹 Component & Layered Architecture: @Component → Generic Spring-managed bean @Service → Business logic layer (helps readability & AOP support) @Repository → Data access layer with automatic exception translation @Controller → Handles web requests (returns views) @RestController → Builds REST APIs (returns JSON/XML) 🔹 Dependency Injection: @Autowired → Injects required dependencies automatically @Qualifier → Resolves ambiguity when multiple beans exist @Primary → Marks a default bean when multiple implementations are available 🔹 Web & REST APIs: @RequestMapping → Maps HTTP requests to controller methods @GetMapping → Handles HTTP GET requests (fetch data) @PostMapping → Handles HTTP POST requests (create data) @PutMapping → Handles HTTP PUT requests (update data) @DeleteMapping → Handles HTTP DELETE requests @RequestBody → Maps request payload to Java object @PathVariable → Reads values from URL path @RequestParam → Reads query parameters @ResponseStatus → Customizes HTTP response status codes 🔹 Configuration & Bean Management: @Configuration → Defines configuration classes @Bean → Explicitly creates and manages a bean @Value → Injects values from properties files @ConfigurationProperties → Binds external configs to POJOs 🔹 Database & JPA: @Entity → Maps Java class to database table @Id → Marks primary key @GeneratedValue → Auto-generates primary key values @Table → Customizes table name and schema @Column → Maps class fields to DB columns @Transactional → Ensures atomic DB operations (rollback on failure) 🔹 Validation: @Valid → Triggers validation on request payload @NotNull → Ensures field is not null @NotBlank → Ensures string is not empty or whitespace @Size → Restricts length of input @Email → Validates email format 🔹 Exception Handling: @ExceptionHandler → Handles specific exceptions in controllers @ControllerAdvice → Centralized exception handling across controllers @RestControllerAdvice → Exception handling for REST APIs (JSON responses) 🔹 Security: @EnableWebSecurity → Enables Spring Security configuration @PreAuthorize → Role/permission-based access control before method execution @Secured → Restricts access using roles 🔹 Scheduling, Async & Caching: @Scheduled → Runs tasks at fixed intervals (cron jobs) @Async → Executes methods asynchronously @EnableCaching → Enables caching mechanism @Cacheable → Caches method results @CacheEvict → Removes cache entries when data changes
9
57
1,835
Java Interview Question: What is the difference between @ PathVariable and @ RequestParam in Spring?✅
6
55
829
Clean REST APIs aren’t just about pretty URLs. They’re about making your endpoints instantly readable and intuitive. @PathVariable in Spring Boot turns messy query params into elegant paths like /users/101/orders/42.
1
1
2
98
@PathVariable in Spring Boot helps extract dynamic values from the URL, making APIs clean and RESTful. It’s widely used to fetch specific resources like users, orders, or products via meaningful endpoints. #Java #SpringBoot #RESTAPI #BackendDevelopment #CleanCode
1
7
364
Yesterday I finally dove into the Spring Boot implementation: Explored @RequestParam, @RequestBody, and @PathVariable feels good to see the endpoints working. Today: building on this and connecting more pieces,one step at a time.
5
144
Spring Boot Interview Questions for 3 Years Experience | Spring Boot Interview Questions & Answers youtu.be/G1twUzlsWkg?si=gNJI… Here are the key Spring Boot interview questions discussed for a candidate with 3 years of experience: What is Spring Boot, and what are its main features? (0:12 - 6:55) What is the difference between Spring and Spring Boot? (6:58 - 12:55) What is the difference between @Bean and @Component? (12:57 - 24:00) What is the difference between @RequestParam and @PathVariable? (24:02 - 28:00) What is Spring Boot DevTools, and why is it used? (28:02 - 32:00) Which embedded servers does Spring Boot support, and how do you change the default? (32:02 - 36:08) What is Spring Boot Actuator? (36:09 - 40:48) What does the @SpringBootApplication annotation do? (40:49 - 44:27) What are @GetMapping, @PostMapping, @PutMapping, and @DeleteMapping? (44:28 - 45:27) What is @RequestBody, and how does Spring convert JSON? (45:28 - 46:26) What is ResponseEntity, and why is it used? (46:27 - 47:32) What are the different types of Dependency Injection (DI)? (47:33 - 49:42) How does Spring Boot support logging? (49:43 - 51:02) What happens when you hit a Spring Boot REST API endpoint? (51:03 - 58:05) What is Inversion of Control (IoC) in Spring? (58:06 - 59:09) What is Dependency Injection in Spring? (59:10 - 1:00:15) What is the Spring IoC Container? (1:00:16 - 1:01:21) What are Spring Beans? (1:01:22 - 1:02:15) What is Bean Scope in Spring? (1:02:16 - 1:03:12) What is Autowiring in Spring? (1:03:13 - 1:04:02) What is the difference between BeanFactory and ApplicationContext? (1:04:03 - 1:04:54) What is Spring AOP (Aspect-Oriented Programming)? (1:04:55 - 1:05:38) What is the role of @Component, @Service, @Repository, and @Controller? (1:05:39 - 1:06:33)

5
53
4,001
How DispatcherServlet works internally. DispatcherServlet is the central front controller in Spring MVC (and still in Spring Boot web applications using Spring MVC under the hood). It implements the front controller design pattern and orchestrates almost the entire request lifecycle. Here is how it works internally, step by step (current Spring 6.x behavior — 2025/2026 era): 1. Request arrives → Web container (Tomcat, Jetty, Undertow…) routes the HTTP request to DispatcherServlet (based on <url-pattern> — very often / or /*). 2. doDispatch() — the heart method (called from doGet(), doPost(), etc.) This protected method contains the real processing logic. 3. getHandler() — find the handler DispatcherServlet asks all registered HandlerMapping beans (in order): Which one can handle this request? Most common: RequestMappingHandlerMapping (the one that understands @RequestMapping / @GetMapping etc.) → Returns HandlerExecutionChain = (Handler object list of interceptors) Handler is usually: - Controller instance specific method (in annotation-driven MVC) -Or HttpRequestHandler, simple servlet-like handler, etc. 4. getHandlerAdapter(handler) DispatcherServlet asks all HandlerAdapter beans: "Which of you knows how to execute this kind of handler?" Almost always → RequestMappingHandlerAdapter wins (the one that understands @Controller, argument resolvers, return value handlers, @ResponseBody, etc.) 5. preHandle() interceptors All interceptors in the chain run preHandle() → can short-circuit the request 6. HandlerAdapter.handle() → RequestMappingHandlerAdapter does the heavy lifting: - Resolves method arguments (HandlerMethodArgumentResolver) Examples: @RequestParam, @PathVariable, @RequestBody, HttpServletRequest, custom converters, etc. Invokes the actual controller method via reflection - Handles return value (HandlerMethodReturnValueHandler) Common cases: - ModelAndView - String logical view name - @ResponseBody / ResponseEntity → message converters (Jackson, Gson…) - void direct response writing - Redirect / forward strings 7. postHandle() interceptors Run after controller execution (can still modify ModelAndView) 8. View resolution (only if we have ModelAndView or logical view name)ViewResolver chain is consulted (most common: InternalResourceViewResolver, ThymeleafViewResolver, ContentNegotiatingViewResolver, etc.) Produces final View object 9. View.render() Renders the view (JSP, Thymeleaf template, FreeMarker…) using model data Or — in REST case — message converter already wrote JSON/XML directly → no view rendering 10. afterCompletion() interceptors Always called (cleanup, logging, transaction commit/rollback, etc.) — even on exception 11. Exception handling flow (can happen at multiple points) If exception occurs → tries HandlerExceptionResolver beans Most common: @ControllerAdvice @ExceptionHandler methods Or SimpleMappingExceptionResolver, DefaultHandlerExceptionResolver, etc. → Can return ModelAndView, ResponseEntity, etc.
1
2
33
Spring @RequestParam vs @PathVariable Annotations: buff.ly/2Ldx8Y6

10
1,058
Feb 18
The only Java Spring Boot concepts you need to know • Spring Boot Setup → @ SpringBootApplication, Spring Initializr • Dependency Injection & IoC → @ Autowired, Bean scopes • Auto-configuration & Starters → reduced boilerplate config • REST API Basics → @ RestController, @ GetMapping, @ PostMapping • HTTP Methods & Routing → @ PutMapping, @ DeleteMapping, @ RequestMapping • Request Handling → @ RequestBody, @ PathVariable, @ RequestParam • Configuration → application .properties, application.yml, Spring Profiles • Spring Data JPA → @ Entity, @ Table, @ Id • Repositories → JpaRepository, derived queries & @ Query • Relationships → @ OneToMany, @ ManyToOne, @ JoinColumn • Validation → @ Valid, @ NotNull, @ Size • Exception Handling → @ ControllerAdvice, @ ExceptionHandler • Security Basics → Spring Security setup, roles & permissions • JWT Authentication → token filters & validation • Transactions → @ Transactional • Actuator → app health, metrics & monitoring • Testing → @ SpringBootTest, @ WebMvcTest, unit & integration tests • Caching → @ Cacheable, cache strategies • Logging → structured logs, logging levels • Reactive Support (optional) → WebFlux for non-blocking apps • Build & Packaging → Maven / Gradle, runnable JAR/WAR
40
55
436
16,520
90% usam essas anotações diariamente. Metade não sabe porque escolheu uma ou outra. Vem aprender: PathVariable VS. RequestParam Segue o fio 👇 #Java #SpringBoot #RestAPI #API #Backend #DevTips
2
2
11
534
Spring Boot Concept That Interviews LOVE to Test !! What is @RequestBody   and how does Spring convert JSON into a Java object? 🔹 Client ( Frontend/Postman ) sends JSON: {  "name": "Elon Musk",  "company": "Tesla",  "age": 52 } 🔹 Controller code: @PostMapping("/users") public User createUser(@RequestBody User user) {   return user; } So… what happens behind the scenes? 🧠 Behind the scenes: 1️⃣ Spring sees @RequestBody   2️⃣ Uses Jackson (JSON library)   3️⃣ Jackson creates an empty Java object   4️⃣ Matches JSON keys with Java fields   5️⃣ Calls setter methods   6️⃣ Java object is ready JSON → Jackson → Java Object What is Jackson? The Magician Jackson → Jackson is the library Spring Boot uses by default   to convert JSON ↔ Java objects automatically. One mental model that never fails: @PathVariable → WHO (resource)   @RequestParam → HOW (options)   @RequestBody → WHAT (data) Most asked & tricky interview questions: Why is a default constructor needed?   → Jackson needs it to create the object first. What if JSON field names don’t match Java fields?   → Mapping fails unless configured. What if extra fields come in JSON?   → Ignored by default (unless strict mode is enabled). Why setters are important?   → Jackson uses them to set values. Once you understand this flow,   Spring Boot stops feeling like magic.
4
83
Spring Boot Interview Question That Traps Beginners.. @PathVariable vs @RequestParam Same data. Different intent. Most beginner developers use them. Few understand when to use which. The mental model that actually works: 🔹 @PathVariable → WHO - Part of the URL path - Mandatory by default - Identifies the resource itself /users/101 🔹 @RequestParam → HOW - Comes after ? - Optional by default ( not mandatory) - Used for filters, search, pagination /users?id=101 One rule to remember forever: WHO the resource is → @PathVariable HOW to fetch it → @RequestParam Interviewers don’t ask this for syntax. They ask it to check API design thinking. Hope this clarified REST APIs for you.
1
5
306
Day 29/100 #100DaysOfCode Today’s practice 👇 Day 3 of Spring Boot 🚀 Built a REST API using: • Spring Boot • @RestController • GET & POST endpoints • @PathVariable & @RequestBody • In-memory data handling Tested everything using Postman #springboot #java
3
29
5th Jan - Dev/Dsa Updates - Learned about REST APIs - Url Http Verb - Annotations such as @RestController, @RequestBody, @PathVariable, @GetMapping and how Rest controller is different from @Component - Solved Merged Intervals Ques
8
196
Spring @PathVariable Annotation: buff.ly/PgS41td

1
17
2,005
🚀#Day22–Spring Security🔐 DONE Authentication & Authorization Role-based access(USER / ADMIN) BCrypt password encryption H2 DB H2 Console Postman testing (session-based security) Debugged real Spring Security issues #SpringBoot #SpringSecurity #Java #Backend #LearningInPublic
1
2
114