Skip to main content

Usa assimExemplo funcional:

public void setSelectedItem(ValueChangeEvent event) { FacesContext context = FacesContext.getCurrentInstance(); selectedItem = context.getApplication().evaluateExpressionGet(context, "#{usuario}", User.class); }

public void setSelectedItem(ValueChangeEvent event) {
     FacesContext context = FacesContext.getCurrentInstance();
     selectedItem = context.getApplication().evaluateExpressionGet(context, "#{usuario}", User.class);
}

Usa assim:

public void setSelectedItem(ValueChangeEvent event) { FacesContext context = FacesContext.getCurrentInstance(); selectedItem = context.getApplication().evaluateExpressionGet(context, "#{usuario}", User.class); }

Exemplo funcional:

public void setSelectedItem(ValueChangeEvent event) {
     FacesContext context = FacesContext.getCurrentInstance();
     selectedItem = context.getApplication().evaluateExpressionGet(context, "#{usuario}", User.class);
}
Fonte Link

Usa assim:

public void setSelectedItem(ValueChangeEvent event) { FacesContext context = FacesContext.getCurrentInstance(); selectedItem = context.getApplication().evaluateExpressionGet(context, "#{usuario}", User.class); }