Can spring framework override Annotation-based configuration with XML-based configuration? -


can spring framework override annotation-based configuration xml-based configuration? need change dependency of bean defined via annotations , not author of bean.

this should ok. spring bean context allows redefine beans, "later" definitions overriding "earlier ones". should apply xml-defined beans annotation-defined beans, if they're mixed.

for example, if have

@configuration public class myannotatedconfig {    @bean     public object beana() {       ...    } } 

<bean class="com.xyz.myannotatedconfig"/>  <bean id="beana" class="com.xyz.beana"/> 

in case, xml definition of beana should take precedence.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -