Search code examples
java-ee-6cdi

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.


Solution

  • 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.