我在理解如何使用註釋時遇到了一些問題,特別是對於bean。Spring註釋組件
我有一個組件
@Component
public class CommonJMSProducer
而且我想在其他類中使用它,我想我能做到這一點有一個唯一的對象
public class ArjelMessageSenderThread extends Thread {
@Inject
CommonJMSProducer commonJMSProducer;
但commonJMSProducer爲空。
在我appContext.xml我有這樣的:
<context:component-scan base-package="com.carnot.amm" />
感謝
如何創建ArjelMessageSenderThread'的'實例? – micha