我有这个 Spring 配置:
<bean id="boo" class="com.x.TheClass"/>
该类TheClass实现TheInterface. 然后我有这个(假设的)Java代码:
@Autowired
TheInterface x;
@Autowired
TheClass y;
作品的自动装配,TheInterface但自动装配TheClass失败。春天给了我一NoSuchBeanDefinitionException堂课。
为什么你可以连接接口而不是类?