Annotation Type Scope
How many instances of a bean there are, and how long each lives.
singleton(the default) -- one, for the life of the server.prototype-- a new one for every injection point.request-- one per HTTP request, built when the request first uses it.session-- one perHttpSession.
A request or session bean injected into a singleton is reached through a
small class the build generates, which finds the current request's instance
on each call. That class extends the bean's, so a request or session bean
cannot be final, needs a constructor taking no arguments, and has that
constructor run once at start-up for the stand-in -- per-request set-up
belongs in @PostConstruct, which runs on each real instance.
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueOne ofsingleton,prototype,requestorsession.
-