What is Scope and What are Spring and Boot Scopes? What is default scope in Spring

@Scope indicates when obejct should be created in container and how many times.

  1. singleton (default scope): Object creted once while starting app
  2. prototype : on every access create new object in container [in multi-threaded env, shared data]
  3. request (web only) : When request came then create object and destroy once response given.
  4. session (webonly) : When login success(Http Session created) then object is created, maintained until logout.
  5. context (not exist now)