struts2.2とspring3.1を使用したアプリがあり、SpringAutowireを無効にしたい。少しググってみたら、<beans>
タブに入れdefault-autowire="no"
ないといけないのですが、うまくいかないようです。
それから私はこの<bean>
ようにすべてのタグに対してこれを宣言できることを知っています:<bean autowire="no">
、しかしこれもうまくいかないようです。
春のデバッグロガーを有効にすると、次のようなメッセージがたくさん表示されます。
情報:デバッグ[http-thread-pool-8080(3)](ConstructorResolver.java:739)-Bean名「com.common.actions.PopupAction」からコンストラクターを介した「intermedService」という名前のBeanへのタイプによる自動配線
そして、applicationConfig.xmlの対応するエントリは次のとおりです。
<beans default-autowire="no"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="PopupAction" scope="prototype" class="com.common.actions.PopupAction" autowire="no">
<constructor-arg type="com.common.services.abs.iIntermedService" ref="intermedService"/>
<constructor-arg type="com.common.services.abs.iLocationService" ref="locationService"/>
<constructor-arg type="com.common.services.abs.iUserService" ref="userService"/>
<constructor-arg type="com.common.services.abs.iPhoneService" ref="phoneService"/>
</bean>
ここで依存関係を手動で定義し、定義している限り、Springがこのアクションを自動配線しようとするのはなぜauto-wire="no"
ですか?
または、このメッセージは、配線がコンストラクターを介してタイプごとに行われたことを示しています(私が望むように)。「タイプ別の自動配線」は、4つのパラメーターからintermedServiceをタイプ別の変数intermedサービスと一致させたことを意味します(順序などではありません) ?