You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonny Wray <jo...@yahoo.com> on 2004/03/04 19:35:09 UTC

Table and session problem

Hi,

I'm having a problem with the contrib:Table component and sessions. My
source for the table is this:

public Collection getDataSource(){
    return ((Visit)getVisit()).getResultList();
}

The visit object result list is populated in another page. All works
fine except when I return to the page after a session time out. I don't
get forwarded to the session time out page (which is what I want) but
instead get an empty table displayed (I guess because a new visit
object is being created in the new session, and the result list is of
course empty).

Anyone any ideas how to get round this,

thanks in advance,
Jonny


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Table and session problem

Posted by Jonny Wray <jo...@yahoo.com>.
Thanks for the reply.

I'm using PageLink to return to the page. It looks like I need to
implement a stateful PageLink.

I tryed your second suggestion earlier this afternoon. When I throw a
StaleSessionException myself I do not get forwarded to
StaleSession.page, but Exception.page instead.

--- Erik Hatcher <er...@ehatchersolutions.com> wrote:
> How are you returning to the page?
> 
> You can specify that DirectLink/ActionLink's are stateful, which
> should 
> take care of this situation for you if it is a hyperlink coming to
> the 
> offending page.
> 
> Also, you can also call IEngine.isStateful() and throw 
> StaleLinkException yourself if you like.
> 
> I haven't tried what I've said here, but seems that these should do
> the 
> trick.
> 
> 	Erik
> 
> On Mar 5, 2004, at 6:44 PM, Jonny Wray wrote:
> >
> > Thanks, I see the difference between engine.getVisit() and
> getVisit()
> > now. But, this still does not solve my problem, I just get a null
> visit
> > object rather than an empty one.
> >
> > Basically, if I return to a page after the session has timed out
> > shouldn't the EngineService detect this, throw a
> StaleSessionException
> > and the framework be forwarded to StaleSession.page? This is what I
> > want to happen, but on this page that uses the visit object I get
> > either a new, empty visit object (if I call getVisit) or a null
> visit
> > object (if I call engine.getVisit()).
> >
> > Any ideas what I'm missing here, or how to fix this?
> >
> > thanks,
> > Jonny
> >
> >
> > --- Marius Siegas <ma...@elinara.ktu.lt> wrote:
> >> engine.getVisit() returns null if session is timed out. I don't
> know
> >> where are you checking for time-out, but you should use
> >> getEngine().getVisit() instead of just getVisit(). Hope that
> helps...
> >>
> >> Jonny Wray wrote:
> >>> Hi,
> >>>
> >>> I'm having a problem with the contrib:Table component and
> sessions.
> >> My
> >>> source for the table is this:
> >>>
> >>> public Collection getDataSource(){
> >>>     return ((Visit)getVisit()).getResultList();
> >>> }
> >>>
> >>> The visit object result list is populated in another page. All
> >> works
> >>> fine except when I return to the page after a session time out. I
> >> don't
> >>> get forwarded to the session time out page (which is what I want)
> >> but
> >>> instead get an empty table displayed (I guess because a new visit
> >>> object is being created in the new session, and the result list
> is
> >> of
> >>> course empty).
> >>>
> >>> Anyone any ideas how to get round this,
> >>>
> >>> thanks in advance,
> >>> Jonny
> >>>
> >>>
> >>>
> >>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> >> tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >> tapestry-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> tapestry-user-help@jakarta.apache.org
> >>
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Table and session problem

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
How are you returning to the page?

You can specify that DirectLink/ActionLink's are stateful, which should 
take care of this situation for you if it is a hyperlink coming to the 
offending page.

Also, you can also call IEngine.isStateful() and throw 
StaleLinkException yourself if you like.

I haven't tried what I've said here, but seems that these should do the 
trick.

	Erik

On Mar 5, 2004, at 6:44 PM, Jonny Wray wrote:
>
> Thanks, I see the difference between engine.getVisit() and getVisit()
> now. But, this still does not solve my problem, I just get a null visit
> object rather than an empty one.
>
> Basically, if I return to a page after the session has timed out
> shouldn't the EngineService detect this, throw a StaleSessionException
> and the framework be forwarded to StaleSession.page? This is what I
> want to happen, but on this page that uses the visit object I get
> either a new, empty visit object (if I call getVisit) or a null visit
> object (if I call engine.getVisit()).
>
> Any ideas what I'm missing here, or how to fix this?
>
> thanks,
> Jonny
>
>
> --- Marius Siegas <ma...@elinara.ktu.lt> wrote:
>> engine.getVisit() returns null if session is timed out. I don't know
>> where are you checking for time-out, but you should use
>> getEngine().getVisit() instead of just getVisit(). Hope that helps...
>>
>> Jonny Wray wrote:
>>> Hi,
>>>
>>> I'm having a problem with the contrib:Table component and sessions.
>> My
>>> source for the table is this:
>>>
>>> public Collection getDataSource(){
>>>     return ((Visit)getVisit()).getResultList();
>>> }
>>>
>>> The visit object result list is populated in another page. All
>> works
>>> fine except when I return to the page after a session time out. I
>> don't
>>> get forwarded to the session time out page (which is what I want)
>> but
>>> instead get an empty table displayed (I guess because a new visit
>>> object is being created in the new session, and the result list is
>> of
>>> course empty).
>>>
>>> Anyone any ideas how to get round this,
>>>
>>> thanks in advance,
>>> Jonny
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Table and session problem

Posted by Jonny Wray <jo...@yahoo.com>.
Thanks, I see the difference between engine.getVisit() and getVisit()
now. But, this still does not solve my problem, I just get a null visit
object rather than an empty one.

Basically, if I return to a page after the session has timed out
shouldn't the EngineService detect this, throw a StaleSessionException
and the framework be forwarded to StaleSession.page? This is what I
want to happen, but on this page that uses the visit object I get
either a new, empty visit object (if I call getVisit) or a null visit
object (if I call engine.getVisit()).

Any ideas what I'm missing here, or how to fix this?

thanks,
Jonny


--- Marius Siegas <ma...@elinara.ktu.lt> wrote:
> engine.getVisit() returns null if session is timed out. I don't know 
> where are you checking for time-out, but you should use 
> getEngine().getVisit() instead of just getVisit(). Hope that helps...
> 
> Jonny Wray wrote:
> > Hi,
> > 
> > I'm having a problem with the contrib:Table component and sessions.
> My
> > source for the table is this:
> > 
> > public Collection getDataSource(){
> >     return ((Visit)getVisit()).getResultList();
> > }
> > 
> > The visit object result list is populated in another page. All
> works
> > fine except when I return to the page after a session time out. I
> don't
> > get forwarded to the session time out page (which is what I want)
> but
> > instead get an empty table displayed (I guess because a new visit
> > object is being created in the new session, and the result list is
> of
> > course empty).
> > 
> > Anyone any ideas how to get round this,
> > 
> > thanks in advance,
> > Jonny
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Table and session problem

Posted by Marius Siegas <ma...@elinara.ktu.lt>.
engine.getVisit() returns null if session is timed out. I don't know 
where are you checking for time-out, but you should use 
getEngine().getVisit() instead of just getVisit(). Hope that helps...

Jonny Wray wrote:
> Hi,
> 
> I'm having a problem with the contrib:Table component and sessions. My
> source for the table is this:
> 
> public Collection getDataSource(){
>     return ((Visit)getVisit()).getResultList();
> }
> 
> The visit object result list is populated in another page. All works
> fine except when I return to the page after a session time out. I don't
> get forwarded to the session time out page (which is what I want) but
> instead get an empty table displayed (I guess because a new visit
> object is being created in the new session, and the result list is of
> course empty).
> 
> Anyone any ideas how to get round this,
> 
> thanks in advance,
> Jonny
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org