This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt 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 Introducing JavaFX 8 Programming this week in the JavaFX 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: 9967
    
    3

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: 9967
    
    3

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
 
It's not a secret anymore!