You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Chris Hane <ch...@gmail.com> on 2007/06/29 21:49:57 UTC

Refresh View after HTTPSession Timeout

I have a generic search screen (standard input form) that displays the 
results on the "next" page using a <tr:table>.

If the user hits the refresh button any time prior to the HTTPSession 
timeout, then the form is resubmitted and the search generated again (could 
display different results if the underlying data has been updated - which 
is what we want to happen).

If the user leaves (for a time greater than the HTTPSession timeout) the 
results screen, comes back and hits the refresh button after the timeout, 
the "Find" screen is displayed again.

I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
side state saving.

One of the first errors in the log is:

2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
restoreView SEVERE: Could not find saved view state for token 7cad43c0

Which is why I'm assuming it is the HTTPSession timeout.

Is there anything I can do so that the "refresh" will re-run the search and 
not show the Find screen?

Thanks,
Chris....


Re: [Trinidad] Refresh View after HTTPSession Timeout

Posted by Chris Hane <ch...@gmail.com>.
That's what I was afraid the answer was going to be.  I was hoping since 
all of the data parameters were passed back in on the browser refresh that 
there might be something I could do.

I've thought about the increasing the timeout (which is 30 minutes right 
now), however to make sure the user never ran into this problem I would 
have to increase it to the same amount of time that I let a user stay 
logged in without having to "relogin".  Users will always complain if I set 
it to anything less than that (which is right now 9 hours) and they hit 
this issue....

Chris....

Simon Lessard wrote:
> Hello Chris,
> 
> I don't see any easy way as if the session timed out you have no way to 
> associate the request with the user therefore you cannot know what the 
> user was searching. You could always persist that data elsewhere, but 
> you would still have the problem of linking that info to the incoming 
> request. I guess you could push an additional cookie in the response and 
> resynch on that one, but then you'll have to deal with browsers 
> disabling cookies... I think increasing the time out would be a simpler 
> option.
> 
> 
> Regards,
> 
> ~ Simon
> 
> On 6/29/07, *Chris Hane* <chrishane@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     I have a generic search screen (standard input form) that displays the
>     results on the "next" page using a <tr:table>.
> 
>     If the user hits the refresh button any time prior to the HTTPSession
>     timeout, then the form is resubmitted and the search generated again
>     (could
>     display different results if the underlying data has been updated -
>     which
>     is what we want to happen).
> 
>     If the user leaves (for a time greater than the HTTPSession timeout) the
>     results screen, comes back and hits the refresh button after the
>     timeout,
>     the "Find" screen is displayed again.
> 
>     I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client
>     side state saving.
> 
>     One of the first errors in the log is:
> 
>     2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM
>     org.apache.myfaces.trinidadinternal.application.StateManagerImpl
>     restoreView SEVERE: Could not find saved view state for token 7cad43c0
> 
>     Which is why I'm assuming it is the HTTPSession timeout.
> 
>     Is there anything I can do so that the "refresh" will re-run the
>     search and
>     not show the Find screen?
> 
>     Thanks,
>     Chris....
> 
> 

Re: Refresh View after HTTPSession Timeout

Posted by Simon Lessard <si...@gmail.com>.
Hello Chris,

I don't see any easy way as if the session timed out you have no way to
associate the request with the user therefore you cannot know what the user
was searching. You could always persist that data elsewhere, but you would
still have the problem of linking that info to the incoming request. I guess
you could push an additional cookie in the response and resynch on that one,
but then you'll have to deal with browsers disabling cookies... I think
increasing the time out would be a simpler option.


Regards,

~ Simon

On 6/29/07, Chris Hane <ch...@gmail.com> wrote:
>
> I have a generic search screen (standard input form) that displays the
> results on the "next" page using a <tr:table>.
>
> If the user hits the refresh button any time prior to the HTTPSession
> timeout, then the form is resubmitted and the search generated again
> (could
> display different results if the underlying data has been updated - which
> is what we want to happen).
>
> If the user leaves (for a time greater than the HTTPSession timeout) the
> results screen, comes back and hits the refresh button after the timeout,
> the "Find" screen is displayed again.
>
> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client
> side state saving.
>
> One of the first errors in the log is:
>
> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>
> Which is why I'm assuming it is the HTTPSession timeout.
>
> Is there anything I can do so that the "refresh" will re-run the search
> and
> not show the Find screen?
>
> Thanks,
> Chris....
>
>

Re: Refresh View after HTTPSession Timeout

Posted by Rupak <Ru...@chordiant.com>.
Hi All,

Even I have got the same problem.
The same issue is there with next link in trinidad table.

When the rows value is less than the no. of rows in the table, it shows next
link.

Any help is highly appreciated.





Ravizzz wrote:
> 
> We have implemented similar way of session timeout in our application
> using filter in web.xml.
> 
> But we are facing one problem with this way of timeout.
> 
> Once Session expires proper logout doesn’t not happen while clicking on
> tabs created in jspx using \<tr:panelTabbed\> tags
> 
> 
> This is very specifically for the tabs and everything works fine while
> clicking on link or buttons etc
> 
> In server logs we get Session Timed Out message, however at UI nothing
> happens, same teb is displayed and never logs out.
> 
> Additionally we get the below message in logs:-
> 
> [3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
> restoreView Could not find saved view state for token -1909e0a
> 
> Any help or pointers would be appreciated.
> 
> 
> chrishane wrote:
>> 
>> I have a generic search screen (standard input form) that displays the 
>> results on the "next" page using a <tr:table>.
>> 
>> If the user hits the refresh button any time prior to the HTTPSession 
>> timeout, then the form is resubmitted and the search generated again
>> (could 
>> display different results if the underlying data has been updated - which 
>> is what we want to happen).
>> 
>> If the user leaves (for a time greater than the HTTPSession timeout) the 
>> results screen, comes back and hits the refresh button after the timeout, 
>> the "Find" screen is displayed again.
>> 
>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
>> side state saving.
>> 
>> One of the first errors in the log is:
>> 
>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>> 
>> Which is why I'm assuming it is the HTTPSession timeout.
>> 
>> Is there anything I can do so that the "refresh" will re-run the search
>> and 
>> not show the Find screen?
>> 
>> Thanks,
>> Chris....
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Refresh-View-after-HTTPSession-Timeout-tp11366195p22490246.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Refresh View after HTTPSession Timeout

Posted by Walter Mourão <wa...@gmail.com>.
Suggestion:

1 - add a javascript state change listener;
2 - check the contents of the request using TrXMLRequestEvent
getResponseText() and/or getResponseStatusCode()
3 - if the result isn't a PPR result, notify the user or send the browser to
a specified url.

I'm planing to write something like that in a couple of weeks. Please reply
if you think it will not work.

Regards,

Walter Mourão
http://waltermourao.com.br
http://arcadian.com.br
http://oriens.com.br



On Fri, Mar 13, 2009 at 4:24 AM, Simon Kitching <sk...@apache.org>wrote:

> Hi,
>
> The solution I use is to put a "ping" script in the page which sends a
> request to the server every couple of minutes. With that, the session
> never times out while the browser window is open, and so the problem
> never occurs.
>
> Of course this requires javascript, but is javascript is disabled then
> so are all AJAX operations so then your filter will handle everything ok.
>
> I don't know of any solution to properly handle session-timeout for ajax
> requests. However I don't use ajax much. Maybe one of the ajax experts
> here can comment on that...
>
> Regards,
> Simon
>
> Ravizzz schrieb:
> > Simon,
> >
> > You are right, Except the links to other jsp/html pages all other
> components
> > like table and tabs give us this problem. Do you know any sort of
> solution
> > for this?
> >
> >
> > Simon Kitching wrote:
> >> My guess is that your timeout-handling approach is failing to work with
> >> any AJAX or frame-based pages, and that these tabs are just one case
> >> where ajax or frames are being used.
> >>
> >> The problem is that when a browser is refreshing a whole page, a filter
> >> can return an http-redirect command and the browser will then replace
> >> the current page with the redirected-to url.
> >>
> >> When the browser is just fetching a frame, only the frame contents will
> >> get directed, not the whole frameset.
> >>
> >> And when a browser is using XmlHttpRequest to do an AJAX operation,
> >> there is no obvious way for a filter to tell the browser to give up and
> >> redirect the current window to a new url. At least not one I know of (I
> >> presume sending back an http-redirect doesn't work..)
> >>
> >> Regards,
> >> Simon
> >>
> >> Ravizzz schrieb:
> >>> We have implemented similar way of session timeout in our application
> >>> using
> >>> filter in web.xml.
> >>>
> >>> But we are facing one problem with this way of timeout.
> >>>
> >>> Once Session expires proper logout doesn’t not happen while clicking on
> >>> tabs
> >>> created in jspx using \<tr:panelTabbed\> tags
> >>>
> >>>
> >>> This is very specifically for the tabs and everything works fine while
> >>> clicking on link or buttons etc
> >>>
> >>> In server logs we get Session Timed Out message, however at UI nothing
> >>> happens, same teb is displayed and never logs out.
> >>>
> >>> Additionally we get the below message in logs:-
> >>>
> >>> [3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
> >>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
> >>> restoreView
> >>> Could not find saved view state for token -1909e0a
> >>>
> >>> Any help or pointers would be appreciated.
> >>>
> >>>
> >>> chrishane wrote:
> >>>> I have a generic search screen (standard input form) that displays the
> >>>> results on the "next" page using a <tr:table>.
> >>>>
> >>>> If the user hits the refresh button any time prior to the HTTPSession
> >>>> timeout, then the form is resubmitted and the search generated again
> >>>> (could
> >>>> display different results if the underlying data has been updated -
> >>>> which
> >>>> is what we want to happen).
> >>>>
> >>>> If the user leaves (for a time greater than the HTTPSession timeout)
> the
> >>>> results screen, comes back and hits the refresh button after the
> >>>> timeout,
> >>>> the "Find" screen is displayed again.
> >>>>
> >>>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with
> client
> >>>> side state saving.
> >>>>
> >>>> One of the first errors in the log is:
> >>>>
> >>>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM
> >>>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
> >>>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
> >>>>
> >>>> Which is why I'm assuming it is the HTTPSession timeout.
> >>>>
> >>>> Is there anything I can do so that the "refresh" will re-run the
> search
> >>>> and
> >>>> not show the Find screen?
> >>>>
> >>>> Thanks,
> >>>> Chris....
> >>>>
> >>>>
> >>>>
> >>
> >> --
> >> -- Emails in "mixed" posting style will be ignored
> >> -- (http://en.wikipedia.org/wiki/Posting_style)
> >>
> >>
> >
>
>

Re: Refresh View after HTTPSession Timeout

Posted by Simon Kitching <sk...@apache.org>.
Hi,

The solution I use is to put a "ping" script in the page which sends a
request to the server every couple of minutes. With that, the session
never times out while the browser window is open, and so the problem
never occurs.

Of course this requires javascript, but is javascript is disabled then
so are all AJAX operations so then your filter will handle everything ok.

I don't know of any solution to properly handle session-timeout for ajax
requests. However I don't use ajax much. Maybe one of the ajax experts
here can comment on that...

Regards,
Simon

Ravizzz schrieb:
> Simon,
> 
> You are right, Except the links to other jsp/html pages all other components
> like table and tabs give us this problem. Do you know any sort of solution
> for this?
> 
> 
> Simon Kitching wrote:
>> My guess is that your timeout-handling approach is failing to work with
>> any AJAX or frame-based pages, and that these tabs are just one case
>> where ajax or frames are being used.
>>
>> The problem is that when a browser is refreshing a whole page, a filter
>> can return an http-redirect command and the browser will then replace
>> the current page with the redirected-to url.
>>
>> When the browser is just fetching a frame, only the frame contents will
>> get directed, not the whole frameset.
>>
>> And when a browser is using XmlHttpRequest to do an AJAX operation,
>> there is no obvious way for a filter to tell the browser to give up and
>> redirect the current window to a new url. At least not one I know of (I
>> presume sending back an http-redirect doesn't work..)
>>
>> Regards,
>> Simon
>>
>> Ravizzz schrieb:
>>> We have implemented similar way of session timeout in our application
>>> using
>>> filter in web.xml.
>>>
>>> But we are facing one problem with this way of timeout.
>>>
>>> Once Session expires proper logout doesn’t not happen while clicking on
>>> tabs
>>> created in jspx using \<tr:panelTabbed\> tags
>>>
>>>
>>> This is very specifically for the tabs and everything works fine while
>>> clicking on link or buttons etc
>>>
>>> In server logs we get Session Timed Out message, however at UI nothing
>>> happens, same teb is displayed and never logs out.
>>>
>>> Additionally we get the below message in logs:-
>>>
>>> [3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
>>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
>>> restoreView
>>> Could not find saved view state for token -1909e0a
>>>
>>> Any help or pointers would be appreciated.
>>>
>>>
>>> chrishane wrote:
>>>> I have a generic search screen (standard input form) that displays the 
>>>> results on the "next" page using a <tr:table>.
>>>>
>>>> If the user hits the refresh button any time prior to the HTTPSession 
>>>> timeout, then the form is resubmitted and the search generated again
>>>> (could 
>>>> display different results if the underlying data has been updated -
>>>> which 
>>>> is what we want to happen).
>>>>
>>>> If the user leaves (for a time greater than the HTTPSession timeout) the 
>>>> results screen, comes back and hits the refresh button after the
>>>> timeout, 
>>>> the "Find" screen is displayed again.
>>>>
>>>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
>>>> side state saving.
>>>>
>>>> One of the first errors in the log is:
>>>>
>>>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
>>>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
>>>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>>>>
>>>> Which is why I'm assuming it is the HTTPSession timeout.
>>>>
>>>> Is there anything I can do so that the "refresh" will re-run the search
>>>> and 
>>>> not show the Find screen?
>>>>
>>>> Thanks,
>>>> Chris....
>>>>
>>>>
>>>>
>>
>> -- 
>> -- Emails in "mixed" posting style will be ignored
>> -- (http://en.wikipedia.org/wiki/Posting_style)
>>
>>
> 


Re: Refresh View after HTTPSession Timeout

Posted by Ravizzz <ra...@gmail.com>.
Simon,

You are right, Except the links to other jsp/html pages all other components
like table and tabs give us this problem. Do you know any sort of solution
for this?


Simon Kitching wrote:
> 
> My guess is that your timeout-handling approach is failing to work with
> any AJAX or frame-based pages, and that these tabs are just one case
> where ajax or frames are being used.
> 
> The problem is that when a browser is refreshing a whole page, a filter
> can return an http-redirect command and the browser will then replace
> the current page with the redirected-to url.
> 
> When the browser is just fetching a frame, only the frame contents will
> get directed, not the whole frameset.
> 
> And when a browser is using XmlHttpRequest to do an AJAX operation,
> there is no obvious way for a filter to tell the browser to give up and
> redirect the current window to a new url. At least not one I know of (I
> presume sending back an http-redirect doesn't work..)
> 
> Regards,
> Simon
> 
> Ravizzz schrieb:
>> We have implemented similar way of session timeout in our application
>> using
>> filter in web.xml.
>> 
>> But we are facing one problem with this way of timeout.
>> 
>> Once Session expires proper logout doesn’t not happen while clicking on
>> tabs
>> created in jspx using \<tr:panelTabbed\> tags
>> 
>> 
>> This is very specifically for the tabs and everything works fine while
>> clicking on link or buttons etc
>> 
>> In server logs we get Session Timed Out message, however at UI nothing
>> happens, same teb is displayed and never logs out.
>> 
>> Additionally we get the below message in logs:-
>> 
>> [3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
>> restoreView
>> Could not find saved view state for token -1909e0a
>> 
>> Any help or pointers would be appreciated.
>> 
>> 
>> chrishane wrote:
>>> I have a generic search screen (standard input form) that displays the 
>>> results on the "next" page using a <tr:table>.
>>>
>>> If the user hits the refresh button any time prior to the HTTPSession 
>>> timeout, then the form is resubmitted and the search generated again
>>> (could 
>>> display different results if the underlying data has been updated -
>>> which 
>>> is what we want to happen).
>>>
>>> If the user leaves (for a time greater than the HTTPSession timeout) the 
>>> results screen, comes back and hits the refresh button after the
>>> timeout, 
>>> the "Find" screen is displayed again.
>>>
>>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
>>> side state saving.
>>>
>>> One of the first errors in the log is:
>>>
>>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
>>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
>>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>>>
>>> Which is why I'm assuming it is the HTTPSession timeout.
>>>
>>> Is there anything I can do so that the "refresh" will re-run the search
>>> and 
>>> not show the Find screen?
>>>
>>> Thanks,
>>> Chris....
>>>
>>>
>>>
>> 
> 
> 
> -- 
> -- Emails in "mixed" posting style will be ignored
> -- (http://en.wikipedia.org/wiki/Posting_style)
> 
> 

-- 
View this message in context: http://www.nabble.com/Refresh-View-after-HTTPSession-Timeout-tp11366195p22481447.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Refresh View after HTTPSession Timeout

Posted by Simon Kitching <sk...@apache.org>.
My guess is that your timeout-handling approach is failing to work with
any AJAX or frame-based pages, and that these tabs are just one case
where ajax or frames are being used.

The problem is that when a browser is refreshing a whole page, a filter
can return an http-redirect command and the browser will then replace
the current page with the redirected-to url.

When the browser is just fetching a frame, only the frame contents will
get directed, not the whole frameset.

And when a browser is using XmlHttpRequest to do an AJAX operation,
there is no obvious way for a filter to tell the browser to give up and
redirect the current window to a new url. At least not one I know of (I
presume sending back an http-redirect doesn't work..)

Regards,
Simon

Ravizzz schrieb:
> We have implemented similar way of session timeout in our application using
> filter in web.xml.
> 
> But we are facing one problem with this way of timeout.
> 
> Once Session expires proper logout doesn’t not happen while clicking on tabs
> created in jspx using \<tr:panelTabbed\> tags
> 
> 
> This is very specifically for the tabs and everything works fine while
> clicking on link or buttons etc
> 
> In server logs we get Session Timed Out message, however at UI nothing
> happens, same teb is displayed and never logs out.
> 
> Additionally we get the below message in logs:-
> 
> [3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView
> Could not find saved view state for token -1909e0a
> 
> Any help or pointers would be appreciated.
> 
> 
> chrishane wrote:
>> I have a generic search screen (standard input form) that displays the 
>> results on the "next" page using a <tr:table>.
>>
>> If the user hits the refresh button any time prior to the HTTPSession 
>> timeout, then the form is resubmitted and the search generated again
>> (could 
>> display different results if the underlying data has been updated - which 
>> is what we want to happen).
>>
>> If the user leaves (for a time greater than the HTTPSession timeout) the 
>> results screen, comes back and hits the refresh button after the timeout, 
>> the "Find" screen is displayed again.
>>
>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
>> side state saving.
>>
>> One of the first errors in the log is:
>>
>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>>
>> Which is why I'm assuming it is the HTTPSession timeout.
>>
>> Is there anything I can do so that the "refresh" will re-run the search
>> and 
>> not show the Find screen?
>>
>> Thanks,
>> Chris....
>>
>>
>>
> 


-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)

Re: Refresh View after HTTPSession Timeout

Posted by Ravizzz <ra...@gmail.com>.
We have implemented similar way of session timeout in our application using
filter in web.xml.

But we are facing one problem with this way of timeout.

Once Session expires proper logout doesn’t not happen while clicking on tabs
created in jspx using \<tr:panelTabbed\> tags


This is very specifically for the tabs and everything works fine while
clicking on link or buttons etc

In server logs we get Session Timed Out message, however at UI nothing
happens, same teb is displayed and never logs out.

Additionally we get the below message in logs:-

[3/4/09 16:19:01:125 IST] 00000035 StateManagerI E
org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView
Could not find saved view state for token -1909e0a

Any help or pointers would be appreciated.


chrishane wrote:
> 
> I have a generic search screen (standard input form) that displays the 
> results on the "next" page using a <tr:table>.
> 
> If the user hits the refresh button any time prior to the HTTPSession 
> timeout, then the form is resubmitted and the search generated again
> (could 
> display different results if the underlying data has been updated - which 
> is what we want to happen).
> 
> If the user leaves (for a time greater than the HTTPSession timeout) the 
> results screen, comes back and hits the refresh button after the timeout, 
> the "Find" screen is displayed again.
> 
> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
> side state saving.
> 
> One of the first errors in the log is:
> 
> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
> restoreView SEVERE: Could not find saved view state for token 7cad43c0
> 
> Which is why I'm assuming it is the HTTPSession timeout.
> 
> Is there anything I can do so that the "refresh" will re-run the search
> and 
> not show the Find screen?
> 
> Thanks,
> Chris....
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Refresh-View-after-HTTPSession-Timeout-tp11366195p22478775.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: [Trinidad] Refresh View after HTTPSession Timeout

Posted by Chris Hane <ch...@gmail.com>.
Scott - thanks for the pointer.

I actually ended up doing something very similar by using a feature of Seam 
that in essence let's me do this without any extra coding on my part. 
There is a feature called "Page Actions" that let's me associate parameters 
(and a whole bunch of other stuff) with a view.  Whenever the view is 
called, it will then marshal the parameters (which in my case are the 
search criteria and offset) into the Find service and execute.  It will 
basically treat it as a GET request which means I don't have to worry about 
  any timeout limits....

Thanks again for your suggestion,
Chris....

Scott O'Bryan wrote:
> Hey Chris,  it's kind of hokey, but if your url contains all the data 
> you need you might be able to create a bunch of managed properties on a 
> managed bean and bind them to the request parameter mappings.  You could 
> then use that managed bean to populate the values in your components.  :)
> 
> Scott
> 
> Chris Hane wrote:
>> I have a generic search screen (standard input form) that displays the 
>> results on the "next" page using a <tr:table>.
>>
>> If the user hits the refresh button any time prior to the HTTPSession 
>> timeout, then the form is resubmitted and the search generated again 
>> (could display different results if the underlying data has been 
>> updated - which is what we want to happen).
>>
>> If the user leaves (for a time greater than the HTTPSession timeout) 
>> the results screen, comes back and hits the refresh button after the 
>> timeout, the "Find" screen is displayed again.
>>
>> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with 
>> client side state saving.
>>
>> One of the first errors in the log is:
>>
>> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
>> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>>
>> Which is why I'm assuming it is the HTTPSession timeout.
>>
>> Is there anything I can do so that the "refresh" will re-run the 
>> search and not show the Find screen?
>>
>> Thanks,
>> Chris....
>>
> 
> 

Re: [Trinidad] Refresh View after HTTPSession Timeout

Posted by Scott O'Bryan <da...@gmail.com>.
Hey Chris,  it's kind of hokey, but if your url contains all the data 
you need you might be able to create a bunch of managed properties on a 
managed bean and bind them to the request parameter mappings.  You could 
then use that managed bean to populate the values in your components.  :)

Scott

Chris Hane wrote:
> I have a generic search screen (standard input form) that displays the 
> results on the "next" page using a <tr:table>.
>
> If the user hits the refresh button any time prior to the HTTPSession 
> timeout, then the form is resubmitted and the search generated again 
> (could display different results if the underlying data has been 
> updated - which is what we want to happen).
>
> If the user leaves (for a time greater than the HTTPSession timeout) 
> the results screen, comes back and hits the refresh button after the 
> timeout, the "Find" screen is displayed again.
>
> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with 
> client side state saving.
>
> One of the first errors in the log is:
>
> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
> restoreView SEVERE: Could not find saved view state for token 7cad43c0
>
> Which is why I'm assuming it is the HTTPSession timeout.
>
> Is there anything I can do so that the "refresh" will re-run the 
> search and not show the Find screen?
>
> Thanks,
> Chris....
>


[Trinidad] Refresh View after HTTPSession Timeout

Posted by Chris Hane <ch...@gmail.com>.
I have a generic search screen (standard input form) that displays the 
results on the "next" page using a <tr:table>.

If the user hits the refresh button any time prior to the HTTPSession 
timeout, then the form is resubmitted and the search generated again (could 
display different results if the underlying data has been updated - which 
is what we want to happen).

If the user leaves (for a time greater than the HTTPSession timeout) the 
results screen, comes back and hits the refresh button after the timeout, 
the "Find" screen is displayed again.

I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client 
side state saving.

One of the first errors in the log is:

2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM 
org.apache.myfaces.trinidadinternal.application.StateManagerImpl 
restoreView SEVERE: Could not find saved view state for token 7cad43c0

Which is why I'm assuming it is the HTTPSession timeout.

Is there anything I can do so that the "refresh" will re-run the search and 
not show the Find screen?

Thanks,
Chris....

Re: [Trinidad] Refresh View after HTTPSession Timeout

Posted by Chris Hane <ch...@gmail.com>.
Marty - thanks for the help.

Actually even with client state saving, the Trinidad framework save state 
on the server (and actually, I have the State saving method set to client) 
and just a token on the client.  I'm not sure of all the things going on 
here, I'm just reporting what I am seeing.

Thanks for the suggestion of saveState.  I'll look at it.

Also, I am using Seam and for anyone reference I wrote another email 
describing the solution I came up with that uses the "Page Actions" found 
in Seam.

Thanks again for your help,
Chris....

Marty Bergerud wrote:
> 
> You can save the page's "viewstate" on the browser by adding this entry 
> to your web.xml file
> 
>     <context-param>
>         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>         <param-value>client</param-value>
>     </context-param>
> 
> That way the page view is restored even after a session timeout.
> 
> 
> You can also use the <t:saveState> tag as in...
> 
> <t:saveState id="saveDialogBean" value="#{dialogBean}"/>
> 
> Marty
> 
> 
> 
> *Chris Hane <ch...@gmail.com>*
> 
> 06/29/2007 02:49 PM
> Please respond to
> "MyFaces Discussion" <us...@myfaces.apache.org>
> 
> 
> 	
> To
> 	MyFaces Discussion <us...@myfaces.apache.org>
> cc
> 	
> Subject
> 	Refresh View after HTTPSession Timeout
> 
> 
> 	
> 
> 
> 
> 
> I have a generic search screen (standard input form) that displays the
> results on the "next" page using a <tr:table>.
> 
> If the user hits the refresh button any time prior to the HTTPSession
> timeout, then the form is resubmitted and the search generated again (could
> display different results if the underlying data has been updated - which
> is what we want to happen).
> 
> If the user leaves (for a time greater than the HTTPSession timeout) the
> results screen, comes back and hits the refresh button after the timeout,
> the "Find" screen is displayed again.
> 
> I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client
> side state saving.
> 
> One of the first errors in the log is:
> 
> 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl
> restoreView SEVERE: Could not find saved view state for token 7cad43c0
> 
> Which is why I'm assuming it is the HTTPSession timeout.
> 
> Is there anything I can do so that the "refresh" will re-run the search and
> not show the Find screen?
> 
> Thanks,
> Chris....
> 
> 

Re: Refresh View after HTTPSession Timeout

Posted by Marty Bergerud <Ma...@notes.ntrs.com>.
You can save the page's "viewstate" on the browser by adding this entry to 
your web.xml file

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

That way the page view is restored even after a session timeout.


You can also use the <t:saveState> tag as in...

<t:saveState id="saveDialogBean" value="#{dialogBean}"/> 

Marty




Chris Hane <ch...@gmail.com>
06/29/2007 02:49 PM
Please respond to
"MyFaces Discussion" <us...@myfaces.apache.org>


To
MyFaces Discussion <us...@myfaces.apache.org>
cc

Subject
Refresh View after HTTPSession Timeout





I have a generic search screen (standard input form) that displays the
results on the "next" page using a <tr:table>.

If the user hits the refresh button any time prior to the HTTPSession
timeout, then the form is resubmitted and the search generated again 
(could
display different results if the underlying data has been updated - which
is what we want to happen).

If the user leaves (for a time greater than the HTTPSession timeout) the
results screen, comes back and hits the refresh button after the timeout,
the "Find" screen is displayed again.

I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client
side state saving.

One of the first errors in the log is:

2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM
org.apache.myfaces.trinidadinternal.application.StateManagerImpl
restoreView SEVERE: Could not find saved view state for token 7cad43c0

Which is why I'm assuming it is the HTTPSession timeout.

Is there anything I can do so that the "refresh" will re-run the search 
and
not show the Find screen?

Thanks,
Chris....