Spring annotation attributes injection:
Common variable type (e.g., String, int) and the like directly value ( "value") to.
For some custom objects, usually @ Autowired, @ resource notes, etc.
- @Autowired is carried out by the object type assignment, then there will be such a problem, how do how to have two of the same type, this time will be thrown, then you can use annotations @Resource assignment, @ Resource is based on the name of the variable assignment to find and then, so there are more objects of the same type can be used @Resource.
- Of course, you can also combine @Qualifier notes at the same time, specify the variable name with @Qualifiter, so that you can assign a find the object, is simply @Resource = @ Autowired + @ Qualifier.