Middle
Which configuration has priority: XML, Java, or annotations?
sobes.tech AI
Answer from AI
Configuration priority order in Spring (from lowest to highest, overriding previous ones):
- XML configuration
- JavaConfig
- Annotations (e.g.,
@Component,@Autowired,@Value,@Primary,@Qualifier)
Thus, annotations have the highest priority and can override configuration set in XML or JavaConfig. Element-level annotations (fields, methods, parameters) have a higher priority than class-level annotations.