Spring Bean

Spring Autowire Use @Component, @Repository, @Service and @Controller Annotations

Besides define Spring beans in configuration file, Spring also provide some java annotation interface for you to make Spring bean declaration simple and easy. These interfaces are also called stereotype annotation. They are @Component, @Repository, @Service and @Controller. If you want to reference such a bean, you just need to annotate that field with @Autowired …

Spring Autowire Use @Component, @Repository, @Service and @Controller Annotations Read More »