I would like to auto-wire foo:
@Autowired
Foo foo
but I cannot modify class Foo
and mark it as @Component
. What is the cleanest way to autowire foo?
BTW, I would prefer to use Java Spring configuration instead of XML config if you need to use config to address this problem.
Related: