@Resource("这里写bean的ID或者Name")如果你的bean也是通过annotation注解的加入是@Service 那你就这么写@Service("这里就是bean的ID")
用反射 或者 instanceof