
在springservlet .xml中:
<context:component-scan base-package="net.controller" />
(我假设服务impl与服务接口“ net.service”位于同一程序包中)
我认为您必须将包net.service(或全部net)添加到组件扫描中。当前,spring仅在net.controller中搜索组件,并且由于您的服务隐含在net.service中,因此Spring不会实例化它。
欢迎分享,转载请注明来源:内存溢出

在springservlet .xml中:
<context:component-scan base-package="net.controller" />
(我假设服务impl与服务接口“ net.service”位于同一程序包中)
我认为您必须将包net.service(或全部net)添加到组件扫描中。当前,spring仅在net.controller中搜索组件,并且由于您的服务隐含在net.service中,因此Spring不会实例化它。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)