可以混合用.文档有说明: Spring can accommodate both styles and even mix them together. 混合用的话,有个先后顺序,xml配置会覆盖annotation.原文: Annotation injection is performed before XML injection, thus the latter configuration will override the former for properties wired throug…