aspose file tools*
The moose likes Applets and the fly likes Prevent timeout on parent jsp where applet resides Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Prevent timeout on parent jsp where applet resides" Watch "Prevent timeout on parent jsp where applet resides" New topic
Author

Prevent timeout on parent jsp where applet resides

Amit Hetawal
Ranch Hand

Joined: Apr 12, 2008
Posts: 48
Hello ALL,
I am having my applet residing inside a jsp, with some buttons present on the jsp which open some different jsp from my ear deployed. Now i get into this weired problem of session timeout of my parent jsp where my applet is residing.
So my problem is even when i start working on my applet, opening new panel from the applet, the main jsp page remains idle. And after a while when i try to click the buttons present on the jsp, it asks me to login again to the server, to access those pages. But my applet still works fine and i can continue working on it.
Is there a way i can avoid this timeout of my jsp, for unlimited time, so i can still access the jsp from the button clicks.

Any suggestions, how can i avoid this.


Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41839
    
  63
The easiest way to prolong the time until the session times out is probably with the <session-timeout> tag in the web.xml file.


Ping & DNS - my free Android networking tools app
Amit Hetawal
Ranch Hand

Joined: Apr 12, 2008
Posts: 48
Hello,
how do i use the <session-timeout>. Am not sure if it will override my company secure login page settings with it, so that i can never timeout, even though the login policy should time me out. Can you please provide some more insight on this.

Please advise,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41839
    
  63
This example web.xml contains a session timeout element. There's no way to change the timeout for just a single JSP - it's all or nothing.

An alternative would be to change the timeout of individual HTTPSession objects; maybe for those users that need to use the applet.

One could also turn around the question and ask: If the JSPs time out, why doesn't the applet?
Abdul Rahman
Ranch Hand

Joined: Jul 04, 2008
Posts: 63
hi,

i've a problem something similar. i've a page that contains two jsps embedded in it. one jsp contains applet and the other jsp is the normal jsp.

the session timeout has been set to 15 mins. my problem starts here.

if i do nothing on the page, it logs me out. Perfect.
if i do some operations (there are some operations that can be done on the applet) on the applet part for more than 15 mins, it logs me out. Here lies the problem.

is there any way of capturing the user activity from the applet and convey the same to the container that the user is still using and accessing the page so that the user is not logged out ?

how can i implement session continuity from the applet ? Please help...

Please also note that we cannot increase the session timeout period because of security concerns.


Abdul
SCJP5, SCWCD5, [scwcd wall of fame]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41839
    
  63
The easiest way would probably be to include an invisible IFRAME along with the applet, which then refreshes itself periodically (say, every few minutes). That way the server would be accessed, and the session wouldn't time out for this page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prevent timeout on parent jsp where applet resides