I have some code, and I don't know why he nor work, when I want call logoutAction()
managed bean function.
<script type="text/javascript">
const sessionTimeOut = #{timeoutBean.getTimeout()};
function startTimer(timeoutCount = 0) {
if (#{request.userPrincipal != null}) {
if (timeoutCount >= sessionTimeOut) {
logoutAction();
}
setTimeout(startTimer, 1000, timeoutCount + 1);
}
}
</script>
and my form
<h:form>
<p:remoteCommand name="logoutAction" actionListener="#{logoutBean.logoutProcess}"/>
</h:form>
Help me please.