私はコントローラーを持っています
package com.controller;
@Controller
public class MyController{
@Autowired
private ISessionHolder holder;
}
私の中でconfig xml
:
<context:component-scan base-package="com.*" />
<bean id="sessionholder" class="com.session.SessionHolder" scope="session">
<aop:scopedProxy/>
</bean>
しかし、私は例外を取得します
no matching bean found for type ISessionHolder used in MyController.
しかし、XMLでセッションホルダーのBean定義を削除して注釈を付けると、正常に機能します。
@Component
@ScopedProxy
public class SessionHolder{
//
}
注釈付きのクラスが最初にインスタンス化されますか、それとも特定の順序がありますか?