Hybrid Configuration Approach in Spring

Overview

Steps in Spring Programming Using Annotations

  1. Remove all <bean> tags from the XML configuration file.

  2. Enable Annotation Support:

  3. Specify Base Package for Spring Beans:

Basic Class-Level Annotations for Spring Container

Key Annotations and Their Usage

  1. @Component:
  2. @Controller:
  3. @Repository:
  4. @Service:
  5. @Scope(value="singleton|prototype|request|session"):
  6. @Lazy(true|false):
  7. @PostConstruct:
  8. @PreDestroy: