@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啊
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
对应的实现类上面能否加了注解,假如加了注解,注解是能否被扫描到了!