我在我的 LanguageOfSystem bean 中使用 CDI Observer 模式。
@Named(value = "languageOfSystem")
@SessionScoped
public class LanguageOfSystem implements Serializable {
@Inject private JsfUtils eeJsfUtils;
@Inject private Event<LangEvent> langEvent;
private LangEvent docLangEvent = new LangEvent();
其中 LangEvent 很简单:
package jav;
import java.util.Locale;
public class LangEvent {
private Locale locale;
public Locale getLocale() {
return locale;
}
public void setLocale(Locale locale) {
this.locale = locale;
}
}
一切正常,但 NetBeans 给了我一个警告:
Unstatisfied dependency: no bean matches the injection point.
我应该检查或改变一些东西吗?