Common Spring IoC Annotations and Their Usage

@Component The @Component annotation signals Spring's IoC container to automatically detect and register the class as a bean during component scanning. @Component public class UserRole { @Value("1") private Long userId; @Value("user_role_admin") private String roleName; @Value("administrative role& ...

Posted on Tue, 29 Sep 2026 16:38:07 +0000 by wesmont

Core Annotations for Bean Management in Spring

Spring provides several annotations to declare components as managed beans with in the container. @Controller: Designates a class as a Spring MVC controller, typically used in conjunction with @RequestMapping. @Controller @RequestMapping("user") public class UserController { @GetMapping("get/{id}") public String get ...

Posted on Thu, 20 Aug 2026 16:09:43 +0000 by mgm_03

How Annotations Work, How to Understand Their Implementation, and a Typical Annotation-driven AOP Workflow

1. The Core Principle of Annotations: "Marker + Parser" Duo Compare an annotation to a label on a package: Annotation = label (e.g., "Fragile", "Keep Refrigerated"). It only describes a property; it performs no action. Parser = courier / warehouse worker. When they see the label, they perform the corresponding act ...

Posted on Sun, 19 Jul 2026 16:22:03 +0000 by quickphp