-
May 26th, 2011, 09:02 AM
#1
Creating new instances of beans.
Hello,
How can I create multiple instances of a bean?
I'm trying to make a loop that will make a new instance of a the same bean and set attributes of that bean.
-Mike
-
May 28th, 2011, 04:14 AM
#2
Hi,
You can set the beans' scope to "prototype" and that will make Spring create a new instance of them whenever they are requested (via injection or ApplicationContext.getBean() method).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules