In this post Dynamic ui:include I asked how I could store an object in some state that could permit me to load a new windows, or tab, of the same browser and it was not stored a
You're trying to get the LoginBean
from the session map. This works only for session scoped beans with the standard JSF @SessionScoped
annotation.
The canonical way to access other beans is using @ManagedProperty
on the retrieving bean.
E.g.
@ManagedBean
@RequestScoped
public class OtherBean {
@ManagedProperty("#{logicBean}")
private LogicBean logicBean;
// Getter+Setter.
}
If you really need to access it inside the method block by evaluating the EL programmatically, you should be using Application#evaluateExpressionGet() instead:
FacesContext context = FacesContext.getCurrentInstance();
LogicBean logicBean = context.getApplication().evaluateExpressionGet(context, "#{logicBean}", LogicBean.class);
// ...