myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [Trinidad] Session is about to expire dialog
Date Mon, 24 Mar 2008 17:55:17 GMT
http://myfaces.apache.org/trinidad/devguide/ppr.html

TrPage.getInstance().getRequestQueue().addStateChangeListener(myCallback);

-Andrew

On Mon, Mar 24, 2008 at 11:39 AM, Richard Yee <richard.k.yee@gmail.com> wrote:
> I do need a hook into the Trinidad PPR mechanism so that I can reset the
> timer whenever a PPR call is made. This will effectively refresh the
> session.
>
> -Richard
>
>
>
>
>
> On 3/24/08, Scott O'Bryan <darkarena@gmail.com> wrote:
> > I see.  So it's not that you need a hook into Trinidad's ppr mechanism
> > so much as you want to generate a ppr request yourself using Trinidad's
> > apis.  Does that about sum it up?
> >
> > Scott
> >
> > Richard Yee wrote:
> > > The client side code would involve using a JavaScript timer that is
> > > created using the standard setTimeout(expression, timeout) call. This
> > > timeout period would be slightly shorter than the timeout period that
> > > is set on the server. The expression argument would call a function to
> > > display the "Session is about to expire dialog". Once the dialog is
> > > displayed, another timer is created that will clear the dialog and
> > > cause an AJAX call that would invoke a servlet to expire the session
> > > on the server if the user doesn't respond within a short amount of
> > > time. If the user clicks the "Continue" dialog button, an AJAX call is
> > > made to a servlet that will refresh the session.
> > >
> > > This is how many online banking applications handle session timeouts.
> > >
> > > -Richard
> > >
> > >
> > >
> > >
> > > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > > <mailto:darkarena@gmail.com>> wrote:
> > >
> > >     I guess I'm confused as to how the code on the client side would
> know
> > >     the session is about to expire without doing a ppr?
> > >
> > >     Scott
> > >
> > >     Richard Yee wrote:
> > >     > Scott,
> > >     > The poll component will not work because I don't want to invoke
> > >     a PPR
> > >     > b/c it will refresh the session. What I need is a hook into the
> > >     > Trinidad JavaScript API like an "onPPR()" method that I can
> override
> > >     > to be notified when a PPR request is made. The purpose of the
> dialog
> > >     > is to tell the user if they are still in front of the screen that
> > >     > their session is about to expire and give them the opportunity to
> > >     > refresh the session rather than have them do something with the
> > >     UI and
> > >     > then get redirected to a page that tells them that their session
> > >     timed
> > >     > out.
> > >     >
> > >     > Thanks,
> > >     >
> > >     > -Richard
> > >     >
> > >     >
> > >     >
> > >     > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > >     <mailto:darkarena@gmail.com>
> > >     > <mailto:darkarena@gmail.com <mailto:darkarena@gmail.com>>>
wrote:
> > >     >
> > >     >     Will the "poll" component in Trinidad do what your asking?
> > >     >
> > >     >
> > >     >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
> > >     >     <richard.k.yee@gmail.com <mailto:richard.k.yee@gmail.com>
> > >     <mailto:richard.k.yee@gmail.com <mailto:richard.k.yee@gmail.com>>>
> > >     wrote:
> > >     >
> > >     >         Hi,
> > >     >         I am currently using a servlet filter to handle session
> > >     >         timeouts to redirect the request to a session expired
> page.
> > >     >         This is working okay except for if the user clicks on the
> > >     >         chooseDate calendar icon after the session times out. With
> > >     >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> > >     >         problem in IE6 (Trinidad-941)), the session expired page
> > >     >         appears in the calendar window instead of the main window.
> > >     >         Once approach to handling this case as well as providing
> the
> > >     >         user a warning before the session is going to timeout is
> to
> > >     >         display a dialog to the user prior to the session
> > >     timeout that
> > >     >         says something like, "Your session is about to timeout"
> > >     with a
> > >     >         Continue button. After a minute or two, the dialog would
> > >     >         automatically be cleared and an AJAX call would be made
> > >     to the
> > >     >         server to force the session expiration. To do this, I
> would
> > >     >         have to have a JavaScript timer that would be started
> > >     when the
> > >     >         page is loaded, reset whenever a PPR call is made, and
> > >     cleared
> > >     >         whenever the page is unloaded. Has anyone implemented this
> > >     >         with Trinidad? Is there a way to get notified via a
> callback
> > >     >         or hook method when a PPR request is made by the Trinidad
> > >     >         JavaScript API? Correctime if I'm wrong, but I don't think
> I
> > >     >         can use the Trinidad dialog framework for this because
> > >     it must
> > >     >         be implemented for every page in the application.
> > >     >
> > >     >         Thanks,
> > >     >
> > >     >         Richard
> > >     >
> > >     >
> > >     >
> > >
> > >
> >
> >
>
>

Mime
View raw message