i ahave an app with struts2.2 and spring 3.1 and i want to disable spring autowire.
I googled a little bit and found that i have to put at <beans>
tab default-autowire="no"
, but this doesn't seems to work.
Then i fount that i can declare this for every <bean>
tag like this : <bean autowire="no">
, but this does not seems to work either.
When i enabled spring debug logger i can see a lot aof messages like this :
INFO: DEBUG [http-thread-pool-8080(3)] (ConstructorResolver.java:739) - Autowiring by type from bean name 'com.common.actions.PopupAction' via constructor to bean named 'intermedService'
and the corresponding entry in applicationConfig.xml is :
<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>
why does spring trying to autowire this action as long as i defined the dependency by hand here and i defined auto-wire="no"
?
Or this message tells me that the wiring was made by type via constructor(as i wanted) and "Autowiring by type" means that from the 4 params he matched intermedService with my variable intermed service by type (and not by order or something else)?