Good question, I'm not sure. I assume that what is declared first wins. Therefore, if your <context:component-scan> first, the automatically detected component will receive a request. If your <bean> comes first, then it wins.
If in doubt, check it out, it should not be hard to find.
The best solution would be to explicitly exclude the component from the scanner using the nested filter elements <context:component-scan> .
source share