0

I want the application show a popup to inform inactive user when he back to use the application that the session is timeout and to click on ok to redirect him to login again.

the first problem i cant detect that the session is timeout .

the second problem evenif i detect that the session is timeout how can i show the popup ?

i tryed o detect the session timeout with a listener but didnt work

   <f:event listener="#{logincontroller.checksessiontimeout}" type="preValidate"/>

i am using primefaces and glassfish.

1 Answers1

0

The problem with the approach you have chosen is the session has timed out, but you already figured it out. )

The solution could be to use ExceptionHandler.

If you really want to show a popup you can redirect to the same page passing some predefined parameter based on which your popup would be rendered. As an alternative you may consider redirection to login page right away and show notification about session expiration there. The second way looks more natural to me, but this is my personal point of view.

You may find information on how to do this in BalusC blog post also you may find some discussion on stackoverflow here with references to other similar questions. Those would still point you to the blog post I mentioned earlier

Community
  • 1
  • 1
jjd
  • 1,749
  • 1
  • 15
  • 28