I created a method in the bean
public void checkSessionLife() {
if (FacesContext.getCurrentInstance().getExternalContext().getSession(false)==null) {
System.out.println("*\n");
System.out.println("destroyed");
FacesContext.getCurrentInstance().addMessage("sessiongr", new FacesMessage(FacesMessage.SEVERITY_INFO, "erer", "errrrrrrrrr"));
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.update(Arrays.asList("hreaderForm:sessiongr"));
}
}
and in my PgTemlate.xhtml
i add a <p:poll>
to update a <p:growl>
<p:poll interval="5" listener="#{accessBean.checkSessionLife()}" process="@this" global="false"/>
<p:growl id="sessiongr" showDetail="true" sticky="true"/>
the problem is that the activity is seen as <p:poll>
activity sessions
There he has another method to notify the user?