Creating a scope bean

Create a @Scope bean to make a prototype scope with @Configuration@Configuration represents the configure file of a SpringBoot project. Here's a piece of code that shows how to use the @Scope prototype annotation:

@Configuration
public class ConfigFoo {
   @Bean
   @Scope("prototype")
   public Foo foo() {
      return new Foo();
   }
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.81.201