Results 1 to 1 of 1

Thread: @Configuration, @Component and scope

Threaded View

  1. #1
    Join Date
    Nov 2011
    Posts
    3

    Default @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
  •