3
這是什麼JavaConfig相當於?aop的Spring JavaConfig:作用域代理
<!-- an HTTP Session-scoped bean exposed as a proxy
that acts as session storage.
-->
<bean id="checkOutCounter" class="org.brightworks.genesis.client.forms.CheckOutCounter" scope="session">
<!-- this next element effects the proxying of the surrounding bean -->
<aop:scoped-proxy/>
</bean>
嘗試宣告它這樣,但它只是作爲一個單身
@Bean
public CheckOutCounter checkOutCounter(){
return new CheckOutCounter();
}
什麼是說的XML配置的相同呢?
凡根據什麼包是DefaultScopes的? – user962206 2015-04-05 14:56:28
這只是一個字符串常量。你可以用''session'替換它' – 2015-04-05 14:58:04
@ScopedProxy怎麼樣? – user962206 2015-04-05 14:58:44