Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Session timeout
Session timeout [message #124056] Mon, 09 March 2009 16:43 Go to next message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Hello,

I want my application works without any session timeouts. So I supposed
that if I create a service handler and implement some code in javascript,
that will request the service handler via ajax, the session will never be
terminated. But It seems this is not working.

I can suppose that I have to add some extra-code to my service function in
my service handler. Is it right? And could you please provide this code if
it possible?

Thank you,
Igor
Re: Session timeout [message #124068 is a reply to message #124056] Mon, 09 March 2009 16:48 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

you should be able to use setMaxInactivateInterval on the HTTPSession .A
negative value indicates that the session should never timeout (see
javadoc).

Cheers
Benny

Igor Pavlenko wrote:
> Hello,
>
> I want my application works without any session timeouts. So I supposed
> that if I create a service handler and implement some code in
> javascript, that will request the service handler via ajax, the session
> will never be terminated. But It seems this is not working.
>
> I can suppose that I have to add some extra-code to my service function
> in my service handler. Is it right? And could you please provide this
> code if it possible?
>
> Thank you, Igor
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Session timeout [message #124093 is a reply to message #124056] Mon, 09 March 2009 18:24 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Igor Pavlenko wrote:
> Hello,
>
> I want my application works without any session timeouts. So I supposed
> that if I create a service handler and implement some code in
> javascript, that will request the service handler via ajax, the session
> will never be terminated. But It seems this is not working.
This is the right approach, probably just a problem in your
implementation. I am almost certain that I read on this group that
someone managed to get this working.

>
> I can suppose that I have to add some extra-code to my service function
> in my service handler. Is it right? And could you please provide this
> code if it possible?
>
> Thank you, Igor
>
Re: Session timeout [message #124143 is a reply to message #124093] Tue, 10 March 2009 09:02 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
>> I am almost certain that I read on this group that someone managed to
get this working.

Search for an answer by Michael Haendel in the thread 'RAP and
(cluster-)failover'
Re: Session timeout [message #124183 is a reply to message #124056] Tue, 10 March 2009 11:46 Go to previous messageGo to next message
p-lex is currently offline p-lexFriend
Messages: 18
Registered: July 2009
Junior Member
I think you just have to call
RWT.getRequest().getSession().setMaxInactiveInterval(-1); In your createUI
method of you EntryPoint:)

I have a simular problem:

I want to restart the application when the sessions timeout is reached.

I need some kind of session timeout event to call the workbench restart
method.

But is this method gona restart the rap session or just the workbench
inside the the rap-session. So I suppose I have to restart the complete
RAP-Session.

Do somebody know how I can do it?
The steps to solve it are:
1. Setting a Session time out (optional, I can keep the default time out)
2. Get a session time out event
3. Restart the rap-session

I dont know how to solve the steps 2 and 3.

best regards,

p-lex
Re: Session timeout [message #124196 is a reply to message #124183] Tue, 10 March 2009 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

Hi,


regarding step 2: you can attach a listener to the current session, try RWT.getSessionStore().addSessionStoreListener(...).
In this listener you must implement the method beforeDestroy(...). This method is called immediately before the session
is destroyed. Maybe this is what you are looking for?! I had some serious headache about the whole session thingy because
the session management is done by the underlying servlet container which makes it quite hard to cope with it sometimes...


greetings,
ben





p-lex schrieb:
> I think you just have to call
> RWT.getRequest().getSession().setMaxInactiveInterval(-1); In your
> createUI method of you EntryPoint:)
>
> I have a simular problem:
>
> I want to restart the application when the sessions timeout is reached.
>
> I need some kind of session timeout event to call the workbench restart
> method.
>
> But is this method gona restart the rap session or just the workbench
> inside the the rap-session. So I suppose I have to restart the complete
> RAP-Session.
>
> Do somebody know how I can do it?
> The steps to solve it are:
> 1. Setting a Session time out (optional, I can keep the default time out)
> 2. Get a session time out event
> 3. Restart the rap-session
>
> I dont know how to solve the steps 2 and 3.
>
> best regards,
>
> p-lex
>
>
>
Re: Session timeout [message #124235 is a reply to message #124196] Tue, 10 March 2009 13:01 Go to previous messageGo to next message
p-lex is currently offline p-lexFriend
Messages: 18
Registered: July 2009
Junior Member
thx for your help. The SessionStoreListener works fine. So now only the
step 3 is left to solve.

I see there is no IWorkbench#restart() method to restart the workbench.
There must be an other way to restart the session or maybe just to tell
the browser to reload the page or something like that.

I'm gonna search for a solution and post it, if not somebody else will do
it before.

p-lex
Re: Session timeout [message #124345 is a reply to message #124143] Thu, 12 March 2009 05:45 Go to previous messageGo to next message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Hi

There was a problem in my js-file (wrong url for ajax request).

Thank you,
Igor
Re: Session timeout [message #124358 is a reply to message #124235] Thu, 12 March 2009 05:48 Go to previous message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Thank you,

I fix the problem. The problem was in my javascript file with ajax request
functions.

Cheers,
Igor
Previous Topic:Trees and memory problems on IE 7
Next Topic:Communicate from applet to a custom widget
Goto Forum:
  


Current Time: Thu Mar 28 23:51:44 GMT 2024

Powered by FUDForum. Page generated in 0.05445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top