私たちのアプリケーションには、ストラットとスプリングが含まれています。Struts アクション クラスも、applicationContext.xml で Spring Bean として構成されます。Spring クラス参照は、「プロパティ」を使用してアクション クラスに接続されます。
例として、
applicationContext.xml
<bean id="sampleAction" class="com.arizona.sample.action.SampleAction">
<property name="sampleManager" ref="sampleManager" />
</bean>
SampleAction では、「sampleManager」参照を使用する静的メソッドを作成する必要がありました。そのため、「sampleManager」を静的変数として構成しました。実行時に、「sampleManager」が使用されている場所で NullPointerExcpetion を取得しました。「sampleManager」は初期化されていないと結論付けました。
誰でもこの点で私を助けてもらえますか?
PS: setSampleManager(..) を提供し、@Autowired も試しました。