你仍然可以在beans.xml文件中的默认bean中使用default-autowire候选(语法突出显示为错误)并且仍然是使用的bean中的主要属性吗?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
default-autowire="byType"
default-autowire-candidates = "consoleWriter,fileWriter">
<bean id="logger" class="com.dylan.spring.test.Logger">
</bean>
<bean name="consoleWriter"
class="com.dylan.spring.test.ConsoleWriter"
primary= "true">
</bean>
<bean name="panda" class="com.dylan.spring.test.ConsoleWriter">
</bean>
<bean name="fileWriter" class="com.dylan.spring.test.FileWriter">
</bean>
<bean name="squirrel" class="com.dylan.spring.test.FileWriter"
autowire-candidate="false">
</bean>
</beans>