我正在编写使用Spring MVC将 Spring bean 与类似 REST 的通道绑定的 Web 应用程序。
<mvc:annotation-driven/>
我已经在我以前的应用程序(纯 XML 配置)和使用功能的示例中创建了基本配置。我<context:component-scan base-package="my.package"/>
在 spring xml 文件中指向一个带有控制器的包。
它在Spring 3.0.6.RELEASE中工作。但是,升级到3.1.0.RELEASE后,我的控制器停止检测,并且没有注册任何频道。Spring 上下文不包含HelloChannel
接口的实现。
这是这个 Spring 版本中的错误,还是我正在使用已弃用的配置,在较新版本中不再支持?我没有收到错误或警告,只是没有自动检测到 bean。
控制器接口定义如下所示:
@RequestMapping("/config") public interface ConfigChannel
和实施:
@Controller
public class ConfigChannelImpl implements ConfigChannel