Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Learn 20+ Spring and Spring Boot Annotations
Rating: 4.5 out of 5(135 ratings)
4,491 students

Learn 20+ Spring and Spring Boot Annotations

Interview Preparation for Beginners - 20+ Spring and Spring Boot Annotations with Line by Line Coding in IntelliJ IDEA
Last updated 11/2023
English
English [Auto],

What you'll learn

  • Learn Spring Core Annotations - @Component, @Autowired, @Qualifier, @Primary, @Bean and @Configuration Annotations
  • Learn Spring MVC Annotations - @Controller, @Service, @Repository, @ResponseBody, @RestController, @RequestMapping Annotations
  • Learn Spring MVC Annotations - @GetMapping, @PostMapping, @RequestBody, @PutMapping Annotation @DeleteMapping Annotation
  • Learn Spring Boot Annotations - @ConfigurationProperties and @SpringBootApplications Annotations

Course content

2 sections17 lectures2h 0m total length
  • @Component Annotation9:06

    Explore the @Component annotation that marks a class as a spring bean and tells the spring container to automatically create and manage that bean in annotation-based configuration.

  • @Autowired Annotation5:05

    The autowired annotation automatically injects a spring bean using constructor, setter, or field injection, demonstrated by injecting a veg pizza bean into a pizza controller.

  • @Qualifier Annotation5:28

    Use the qualifier annotation to tell the spring container which bean to inject when an interface has multiple implementations, such as veg pizza or non-veg pizza.

  • @Primary Annotation3:24

    Use the @Primary annotation to give higher priority to a bean when multiple Spring beans implement the same type, enabling unambiguous injection.

  • @Bean and @Configuration Annotations12:56

    Explore how @Bean creates spring beans in a java-based configuration and how @Configuration marks a configuration class. Learn to define beans, inject dependencies, and use initMethod and destroyMethod for lifecycle.

  • @Controller, @Service and @Repository9:02

    Learn how stereotype annotations, derived from component, auto-create Spring beans in the three-layer architecture—controller, service, and repository—within a Spring container, using @Controller, @Service, and @Repository.

  • @Lazy Annotation6:20

    Learn how Spring eagerly creates beans at application context startup and how @Lazy loads beans on demand, shown with eager and lazy loader examples.

  • @ConfigurationProperties Annotation16:32

    Bind external configurations to a strongly typed string bean using the configuration properties annotation, including nested objects, maps, and a prefix in a Spring Boot application.

  • @Controller and @ResponseBody Annotations9:47

    Explore how the @Controller and @ResponseBody annotations turn a Java class into a Spring MVC controller, enable request handling with @RequestMapping, and return JSON responses via HTTP.

  • @RestController Annotation4:52

    Discover how the rest controller annotation acts as a shortcut that replaces at controller and at response body annotations to build RESTful services with Spring MVC.

  • @RequestMapping Annotation8:34

    Map web requests to Spring controller methods using the @RequestMapping annotation, configuring base URLs, class- and method-level mappings, multiple URLs, HTTP methods, and producers and consumes attributes.

  • @GetMapping Annotation4:52

    Learn how the get mapping annotation is a shortcut for request mapping plus http get, map single or multiple urls using the value attribute, and control media types like application/json.

  • @PostMapping and @RequestBody Annotations10:26

    Use @PostMapping and @RequestBody to map http post requests, consume json via application/json, and convert it to a Java object; test with Postman and verify http status 201.

  • @PutMapping Annotation7:31

    Learn how the @PutMapping annotation maps HTTP put requests to a handler. Use it as a shortcut for @RequestMapping with method put to update a book.

  • @DeleteMapping Annotation5:05

    Explain how the delete mapping annotation acts as a shortcut for add request mapping with http delete. Show binding the template variable to the method parameter with a path variable.

  • Source Code0:02

Requirements

  • Java 17 or later
  • Spring and Spring Boot Basics

Description

In this course, I will cover the following 20+ spring and spring boot annotations with line-by-line coding in IntelliJ IDEA. We gonna use the latest version of Spring Boot 3 and Java 17.


These 20+ annotations are frequently asked in interviews for beginners so I highly recommend going through these annotations before an interview.


Spring and Spring Boot Annotations:

Component Annotation

Autowired Annotation

Qualifier Annotation

Primary Annotation

SpringBootApplication

Bean and Configuration Annotations

Controller, Service, and Repository

Lazy Annotation

Scope Annotation

Value Annotation

PropertySource and PropertySources Annotations

ConfigurationProperties Annotation

Controller and ResponseBody Annotations

RestController Annotation

RequestMapping Annotation

GetMapping Annotation

PostMapping and RequestBody Annotations

PutMapping Annotation

DeleteMapping Annotation

PathVariable Annotation

RequestParam Annotation


What is Spring Framework?

Spring Framework is a popular open-source Java-based application framework that provides a comprehensive infrastructure for developing Java applications. It was initially created to simplify the development of enterprise applications, but it has since expanded to become a general-purpose framework for developing any kind of Java application.


What is Spring Boot?

Spring Boot is basically an extension of the Spring framework which eliminates the boilerplate configurations required for setting up a Spring application.

Spring Boot is an opinionated framework that helps developers build Spring-based applications quickly and easily. The main goal of Spring Boot is to quickly create Spring-based applications without requiring developers to write the same boilerplate configuration again and again.


Tools and technologies used:

- Spring Boot 3

- Java 17 or later

- IntelliJ IDEA

- Maven

- Postman

Who this course is for:

  • This course is for beginners who are doing preparation for Java interviews.