문제

I know that I can use Autowired annotation on method.

for example:

    @Autowired
    public void someMethod(Object obj1, MyObj obj2, AnotherClass obj3, TestClass obj4){...}

What rules uses at this case?

obj1 obj2 obj3 obj4

should be in context?

or only one?

or nothing

Can I specified it?

도움이 되었습니까?

해결책

All method arguments should be resolvable by the application context. You can also use @Qualifer annotation to resolve ambiguities.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top