viniciusjssouza
viniciusjssouza

Reputation: 1275

CDI constructor injection of a request scoped object

Is it possible to inject a request scoped CDI component into a application scoped CDI component via construction injection? The point is that, when the application scoped object is instantiated, the request scoped object might not exist.

Upvotes: 2

Views: 1166

Answers (1)

covener
covener

Reputation: 17872

You're free to do this, you get a proxy injected that obtains/creates the appropriate instance when you call a business method on it.

Upvotes: 2

Related Questions