List some of the Spring Framework Annotations?

Core Spring Framework Annotations

  • @Required
  • @Autowired
  • @Qualifier
  • @Configuration
  • @Bean
  • @Lazy
  • @Value

Spring Framework Stereotype Annotations

  • @Component
  • @Controller
  • @Service
  • @Repository

Spring Boot Annotations

  • @EnableAutoConfiguration
  • @SpringBootApplication

Spring MVC and REST Annotations

  • @RequestMapping
    • @GetMapping
    • @PostMapping
    • @PutMapping
    • @PatchMapping
    • @DeleteMapping
    • @ExceptionHandler
    • @InitBinder
    • @Mappings
    • @Mapping
    • @MatrixVariable
    • @PathVariable
    • @RequestAttribute
    • @RequestBody
    • @RequestHeader
    • @RequestParam
    • @RequestPart
    • @ResponseBody
    • @ResponseStatus
    • @ControllerAdvice
    • @RestController
    • @RestControllerAdvice
    • @SessionAttribute
    • @SessionAttributes
  • @CookieValue
  • @Controller
  • @CrossOrigin

Spring Cloud Annotations

  • @EnableConfigServer
  • @EnableEurekaServer
  • @EnableDiscoveryClient
  • @EnableCircuitBreaker
  • @HystrixCommand

Spring Framework DataAccess Annotations

  • @Transactional

Cache-Based Annotations

  • @Cacheable
  • @CachePut
  • @CacheEvict
  • @CacheConfig

Task Execution and Scheduling Annotations

  • @Scheduled
  • @Async

Spring Framework Testing Annotations

  • @BootstrapWith
  • @ContextConfiguration
  • @WebAppConfiguration
  • @Timed
  • @Repeat
  • @Commit
  • @RollBack
  • @DirtiesContext
  • @BeforeTransaction
  • @AfterTransaction
  • @Sql
  • @SqlConfig
  • @SqlGroup
  • @SpringBootTest
  • @DataJpaTest
  • @DataMongoTest
  • @WebMVCTest
  • @AutoConfigureMockMVC
  • @MockBean
  • @JsonTest
  • @TestPropertySource

What is Spring Framework ?

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework’s core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform.

It is a lightweight, loosely coupled and integrated framework


How configuration metadata is provided to the Spring container?

Configuration metadata can be provided to Spring container in following ways:

  1. XML-Based configuration
  2. Annotation-Based configuration
  3. Java-based configuration

XML-Based configuration: In Spring Framework, the dependencies and the services needed by beans are specified in configuration files which are in XML format. These configuration files usually contain a lot of bean definitions and application specific configuration