If i have a spring bean defined using both xml configuration and annotation. Then while initialization, which have more priority, xml or annotations.
Like my bean is...
package com.abc;
@Component
Class Demo{
...
}
And my xml configuration is...
...
<context:annotation-config />
<context:component-scan base-package="com.abc" />
<bean id="demo" class="com.abc.Demo"/>
...
Now the demo bean is defined using both xml and annotations. While initialization, who is initializing bean: annotation or xml.
Annotation injection is performed before XML injection. Thus, the latter configuration will override the former for properties wired through both approaches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With