What is the JavaConfig equivalent of this?
<!-- 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>
Tried declaring it like this but it only acts as a singleton
@Bean
public CheckOutCounter checkOutCounter(){
return new CheckOutCounter();
}
What is the equivalent of the said xml config?
For component initialization:
@Component
@Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES)
For @Bean:
@Bean
@Scope(value="session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public CheckOutCounter checkOutCounter(){
return new CheckOutCounter();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With