在controller中有
@autowired
private IService service;
在service中有
@autowired
private IDao dao;
我的问题是: 两个之中都有@autowired, 那么哪一个先起作用; 为什么?
我自己测的时候,发现应该是controller中的先起作用; 才去遍历注入的service中的dao
; 如果没有controller, 那么dao将空指针
在controller中有
@autowired
private IService service;
在service中有
@autowired
private IDao dao;
我的问题是: 两个之中都有@autowired, 那么哪一个先起作用; 为什么?
我自己测的时候,发现应该是controller中的先起作用; 才去遍历注入的service中的dao
; 如果没有controller, 那么dao将空指针