在构建期间
DataController,通常
dataProvider为null。之后进行注射。
您应该添加一种
@PostConstruct方法来检查该字段是否为空:
@PostConstructvoid init() { // dataProvider should not be null here.}此外,关于Weld的错误报告也做得很好。因此,如果注入失败,您应该有一个明确且详细的错误消息,而不仅仅是空字段。

在构建期间
DataController,通常
dataProvider为null。之后进行注射。
您应该添加一种
@PostConstruct方法来检查该字段是否为空:
@PostConstructvoid init() { // dataProvider should not be null here.}此外,关于Weld的错误报告也做得很好。因此,如果注入失败,您应该有一个明确且详细的错误消息,而不仅仅是空字段。