File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 9351
    
    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: 9351
    
    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