File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Show popup when session time out

 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi in my application i need to show a popup when session is expires... As of now when we make a event on page once after a session time out it will say session time out..
But now i need to show a pop up once session expires.. please help me how to do this....

Thanks
Aishwarya
 
Chris Hunter
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it need to be a pop-up or can it be handled by an error page? Session expiry is only known to the server when the user makes a request so they are already navigating, I suppose you could use some AJAX on every request that checks session status prior to navigating



Java Tutorial
 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any change of redirecting to some page or show a pop up directly from servlet when session expires...
 
adil qureshi
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see it depends on how you are handling the session.... What you can do that as your session expire send the request to a jsp or an intermediate HTML page and then close this one on body load .... close this page and from here open your pop .... hope that will solve your purpose .....
 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
adil qureshi wrote:see it depends on how you are handling the session.... What you can do that as your session expire send the request to a jsp or an intermediate HTML page and then close this one on body load .... close this page and from here open your pop .... hope that will solve your purpose .....



How to make a event at the time of session failure..... For example i need to do something when session failure.....How to do it....
 
adil qureshi
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session failure ....? are you talking about session invalidated or what ... any ways that will be some error code just do this in web.xml
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/pages/errorPage.jsp</location>
</error-page>

<error-page>
<error-code>403</error-code>
<location>/WEB-INF/pages/errorPage.jsp</location>
</error-page> and use this as an intermediate page also you can use the same page again using some different parameters
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course not. When the session expires on the server, how would you know which of the billion nodes connected to the Internet to alert (even if you could)?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic