IDNStudy.com, ang iyong mapagkukunan ng mabilis at pangkomunidad na mga sagot. Tuklasin ang libu-libong mga sagot na na-verify ng mga eksperto at hanapin ang mga solusyong kailangan mo, anuman ang paksa.
Answer:
you can use Spring's component scan to autowire your beans.
Simply add
<context:component-scan base-package="<PACKAGE>" />
to your applicationContext.xml. You have to replace "" with the package you want to scan for beans.
Also, you have to annotate your beans with
@Component
to say "hey, this is a bean" to Spring. To inject dependencies into other beans, simply tag the field with