Announcement Announcement Module
Collapse
No announcement yet.
@Configuration, @Component and scope Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @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, 12:58 PM.
Working...
X