Per Spring 3 document, The IoC container, the @Named annotation is a standard equivalent to the @Component annotation.
Since @Reposit
@Named works the same as @Component. However, the annotations @Controller, @Service, and @Repository are more specific.
From the Spring docs:
@Componentis a generic stereotype for any Spring-managed component.@Repository,@Service, and@Controllerare specializations of@Componentfor more specific use cases, for example, in the persistence, service, and presentation layers, respectively.For example, these stereotype annotations make ideal targets for pointcuts. It is also possible that
@Repository,@Service, and@Controllermay carry additional semantics in future releases of the Spring Framework. Thus, if you are choosing between using@Componentor@Servicefor your service layer,@Serviceis clearly the better choice. Similarly, as stated above,@Repositoryis already supported as a marker for automatic exception translation in your persistence layer.
This section explains the difference with @Named.
Many components, like Spring's DispatcherServlet (MVC configuration in WebApplicationContext) aren't looking for Component, they are looking for @Controller. So when it scans your class, it won't find it in @Named. In a similar fashion, transaction management with @Transactional looks for @Service and @Repository, not for the more generic @Component.
All @Repository, @Service and @Controller are mainly for declaring Spring beans, apart from that it gives extra information to Spring about the type of bean like controller, dao etc