我有一個Web控制器,其餘使用彈簧3豆沒有被有線正確
<mvc:annotation-driven />
<context:annotation-config />
<context:component-scan base-package="com.ecommerce.web.controller" />
控制器具有註解@Controller像下面在控制器-config.xml中配置。
@Controller
public class HomeController
我已經包含在依賴的@Autowired註解,但是當我第一次啓動該應用程序我無法對有線對象設置任何屬性。
例如,我有一個storeProfile對象,當我在調試模式下看到它有多個屬性應該設置。 但是,當我嘗試在@Autowried bean上設置一個storeProfile屬性時,它仍然爲空或空字符串!?
如果你看看附件圖片它表明我逐步進行線this.storeProfileContext.setStoreProfile(storeProf ILE)後調試仍顯示storeProfile屬性爲空
其實,有幾個依賴其看起來像它們被創建(它們不是null和應用程序函數),但我無法對這些對象設置任何內容。
我在春季論壇也問過同樣的問題 - 希望能夠解決這個問題。
非常感謝!
是的!非常感謝你的教訓。我在 上做了一些閱讀。 –
Carl