Skip to content
tylertreat edited this page Dec 31, 2012 · 1 revision

The Scope annotation is used to declare the scope of a bean, prototype or singleton. If not specified, a bean takes on the singleton scope. The annotation has a single value which is used to declare the scope.

Scope Example

The below example illustrates the usage of the Scope annotation. This particular example declares a prototype bean.

@Bean
@Scope("prototype")
public class MyPrototypeBean {

}

Clone this wiki locally