-
Dec 11th, 2011, 10:28 AM
#1
@Configuration, @Component and scope
Hi,
I am just wondering why this part of code:
@Configuration
public class AppConfig {
@Bean
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public SomeClass getSomeClass(){
…
}
}
does not work. However this is legall:
@Component
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class SomeClass {
…
}
Why it is forbidden to create bean with scope request in class annotated as Configuration?
Last edited by slowikps; Dec 11th, 2011 at 11:58 AM.
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