Usman Awan
Usman Awan

Reputation: 1258

Is Application Context in Spring Framework user specific or application specific?

Is application context you load from .xml file is user specific level or application level, like context is once loaded for all the user? or every user has separate application context?

while using spring framework in java?

Upvotes: 2

Views: 1250

Answers (3)

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 298838

The context is application-wide, but individual beans can have narrower scopes.

The most common scopes are

  • singleton (default: one per application)
  • prototype (a new bean is created each time one is requested)
  • request (one bean per HTTP request)
  • session (one bean per HTTP session)

Obviously, the latter two types are user-specific beans.

Reference:

Upvotes: 6

Nathan Hughes
Nathan Hughes

Reputation: 96385

It's application-specific, it applies to the entire application.

Upvotes: 1

hvgotcodes
hvgotcodes

Reputation: 120188

The application context is application level. It doesn't really make sense to talk about it as being tied to users.

Upvotes: 0

Related Questions