This content has been marked as final.
Show 2 replies
-
1. Re: bean instantiated every time, thow it has @Scope(ScopeType.APPLICATION)
amitev Apr 20, 2010 11:29 PM (in response to kux)This what you do here is wrong. You explicitly instantiate ResourceLocatorImpl(), so a new instance of ResourceLocatorImpl will be created every time an instance of FileUploader os created.
Do it the following way:@Name("fileUploader") public class FileUploader { @In private ResourceLocator resourceLocator; } @Name("resourceLocator") @Scope(ScopeType.APPLICATION) @Startup public class ResourceLocatorImpl implements ResourceLocator { }
-
2. Re: bean instantiated every time, thow it has @Scope(ScopeType.APPLICATION)
kux Apr 21, 2010 5:07 PM (in response to kux)Of course... Didn't use DI when I first
prototyped
the class, and then when I added it I forgot the explicit instantiation there...