2010-05-31 88 views

回答

3

您不能使用"#{httpParams}"來引用其他豆。

本替換你的構造:

<constructor-arg ref="httpParams" /> 
+0

春天記錄沒有按」不要說在調試模式爲什麼應用程序上下文初始化失敗... http://pastebin.com/87cF2Mhp ...你可以請看一看時間? – lisak 2010-05-31 23:47:53

+0

您是否需要依賴屬性?我從來不需要這個;在默認情況下,Spring通常很好地管理這些東西。我認爲你可能會造成循環依賴。 – AngerClown 2010-06-01 00:00:56

+0

沒有它們的結果是一樣的...... btw它以這種方式開始: ApplicationContext ctx = new ClassPathXmlApplicationContext(「app-context.xml」); logger.debug(「ApplicationContext ready」);線程管理器threadManager =(ThreadManager)ctx.getBean(「threadManager」); – lisak 2010-06-01 00:15:43

0

得到它,它必須是這樣的: 「<property name="targetObject"><ref local="schemeReg"/></property>


<bean id="plainSocketFactory" class="org.apache.http.conn.scheme.PlainSocketFactory" 
     factory-method="getSocketFactory"/> 

<bean id="scheme" class="org.apache.http.conn.scheme.Scheme"> 
    <constructor-arg value="http"/> 
    <constructor-arg ref="plainSocketFactory"/> 
    <constructor-arg type="int" value="80" /> 
</bean> 

<bean id="schemeReg" class="org.apache.http.conn.scheme.SchemeRegistry"/> 

<bean id="configurator" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> 
    <property name="targetObject"><ref local="schemeReg"/></property> 
    <property name="targetMethod" value="register"/> 
    <property name="arguments"> 
     <list> 
      <ref bean="scheme"/> 
     </list> 
    </property> 
</bean> 

謝謝你們