spring注解问题求帮助

J2EE 码拜 8年前 (2016-03-12) 895次浏览
@Service
public interface IBaseService<T> {}
@Service(“wtsbmxService”)
public interface IWtsbmxService  extends IBaseService<WtsbmxPO> {}
@Controller
@RequestMapping(value=”/service”)
public class AgreementController {
@Resource(name=”wtsbmxService”)
private IWtsbmxService wtsbmxService;
}
求帮助,为何这种写法有什么错误,为什么启动tomcat时,一直提示找不到name为本人定义的wtsbmxService的bean啊
解决方案

20

对应的实现类上面能否加了注解,假如加了注解,注解是能否被扫描到了!

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明spring注解问题求帮助
喜欢 (0)
[1034331897@qq.com]
分享 (0)