enable CDI injection into a bean created by a producer method
问题 Producer methods are very useful for creating instances programmatically and publishing them in a context. The problem is that all properties of an instance created by new and returned by a producer method are not injected by CDI. In the Weld documentation I've read that this is an intentional behaviour, but in many cases injection in those beans would be very useful. Is there a workaround to enable injection into such beans? 回答1: First, I have to ask why you are using Producers for beans