When I call getBean(name)
on a BeanFactory
, I get back an instance of the bean defined in the application context. However, when I call getB
The default scope is singleton, but you can set it to prototype, request, session, or global session.
You need to tell spring that you want a prototype bean rather than a singleton bean
<bean id="beanA" class="misc.BeanClass" scope="prototype"/>
This will get you a new instance with each request.