This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Spring and the fly likes Injecting Scoped Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Injecting Scoped Beans" Watch "Injecting Scoped Beans" New topic
Author

Injecting Scoped Beans

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9466
    
    2

Why do we need to specify a proxy when we inject a scoped bean into another bean?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9466
    
    2

To some extent I can make out that we need a proxy in case of session, request and global session scoped beans. But why not for a prototype scoped bean? I guess when we inject a prototype scoped bean in a singleton, we need the proxy to get to the original new instance of the prototype bean. Am I right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Injecting Scoped Beans