You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mike Davis <md...@lookhere.co.za> on 2007/05/02 23:45:53 UTC
Tapestry 3 DirectLink and stateful
Hi all,
I've been asked to do some work on a Tapestry 3 application
(unfortunately I can't upgrade it!) and I'm struggling with a
DirectLink/session issue. I would like to allow our users to
access certain pages without session, yet still be able to return to
pages that require a session, without losing any stored state.
Is it possible to create a Tapestry app that allows a user to do the
following?
- open a page that creates and uses a visit object
- click a DirectLink with the stateful flag set to false
- go back to the first page and use the original visit object again
Is it correct to say that once a DirectLink is clicked with the
stateful flag set to false, any session data associated with that
user's session is invalidated?
Thanks
Mike Davis
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 3 DirectLink and stateful
Posted by Andreas Andreou <an...@di.uoa.gr>.
hey, was there client persistence in Tap 3 ???
On 5/3/07, Jesse Kuhnert <jk...@gmail.com> wrote:
>
> Unless they are using client persistence? In which case yes, you'd lose
> all
> of it. (of course you could do something fancy like mixing it up somehow
> or
> using cookies but that's something different..)
>
> On 5/2/07, Andreas Andreou <an...@di.uoa.gr> wrote:
> >
> > not, that's not correct... session is not invalidated when clicking on a
> > DirectLink having the stateful flag set to false
> >
> > What exactly is the problem you're facing?
> >
> > On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
> > >
> > > Hi all,
> > >
> > > I've been asked to do some work on a Tapestry 3 application
> > > (unfortunately I can't upgrade it!) and I'm struggling with a
> > > DirectLink/session issue. I would like to allow our users to
> > > access certain pages without session, yet still be able to return to
> > > pages that require a session, without losing any stored state.
> > >
> > > Is it possible to create a Tapestry app that allows a user to do the
> > > following?
> > > - open a page that creates and uses a visit object
> > > - click a DirectLink with the stateful flag set to false
> > > - go back to the first page and use the original visit object again
> > >
> > > Is it correct to say that once a DirectLink is clicked with the
> > > stateful flag set to false, any session data associated with that
> > > user's session is invalidated?
> > >
> > > Thanks
> > > Mike Davis
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> > Tapestry / Tacos developer
> > Open Source / JEE Consulting
> >
>
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
Re: Tapestry 3 DirectLink and stateful
Posted by Jesse Kuhnert <jk...@gmail.com>.
Unless they are using client persistence? In which case yes, you'd lose all
of it. (of course you could do something fancy like mixing it up somehow or
using cookies but that's something different..)
On 5/2/07, Andreas Andreou <an...@di.uoa.gr> wrote:
>
> not, that's not correct... session is not invalidated when clicking on a
> DirectLink having the stateful flag set to false
>
> What exactly is the problem you're facing?
>
> On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
> >
> > Hi all,
> >
> > I've been asked to do some work on a Tapestry 3 application
> > (unfortunately I can't upgrade it!) and I'm struggling with a
> > DirectLink/session issue. I would like to allow our users to
> > access certain pages without session, yet still be able to return to
> > pages that require a session, without losing any stored state.
> >
> > Is it possible to create a Tapestry app that allows a user to do the
> > following?
> > - open a page that creates and uses a visit object
> > - click a DirectLink with the stateful flag set to false
> > - go back to the first page and use the original visit object again
> >
> > Is it correct to say that once a DirectLink is clicked with the
> > stateful flag set to false, any session data associated with that
> > user's session is invalidated?
> >
> > Thanks
> > Mike Davis
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Tapestry 3 DirectLink and stateful (Thanks a lot!)
Posted by Mike Davis <mi...@lookhere.co.za>.
Hi,
Thanks for that - it solved my problem neatly ...
I'd also like to say thanks to the list - great to see a big community
that helps out so quickly and politely!
Thnks
Mike
On Thu, 03 May 2007 15:46:18 +0100
Richard Kirby <rb...@capdm.com> wrote:
> Hi Mike,
>
> I think you will find that the cookie used for session tracking is
> actually generated by the servlet engine
> (Tomcat/Jetty/Weblogic/whatever) and nothing to do with Tapestry.
>
> However, since cookies are nothing but HTTP header lines, you could
> always use a Filter to hack the cookie header line. Alternatively, if
> you are using mod_proxy to hook your apache to your servlet engine,
> look into using ProxyPassReverseCookiePath and
> ProxyPassReverseCookieDomain.
>
> Cheers
>
> Richard
>
> Mike Davis wrote:
> > Hi,
> >
> > As it turns out, the problem is actually that I've used Apache's
> > mod_rewrite to transparently eliminate the context part of the path
> > ('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the
> > context as part of the cookie's path ...
> >
> > Is there a way to setup Tapestry so that it will set up the cookie
> > path without the context (or with an alternate path)? I have other
> > applications on the same app server, so I still need to keep the
> > apps in seperate contexts.
> >
> > I have taken a look in the code and I suppose I could simply hack it
> > until it works, but obviously I'm hoping that it's possible just
> > using a config file.
> >
> > Thanks
> > Mike Davis
> >
> >
> > On Thu, 3 May 2007 08:47:10 +0200
> > Mike Davis <md...@lookhere.co.za> wrote:
> >
> >
> >> Hi,
> >>
> >> The problem is that I have a page that I'd like users to be able to
> >> access with or without a session. This works fine, but calling
> >> getVisit() on that page returns null whether or not the user
> >> previously had an accessible visit object. Once a user has been to
> >> that page, calls to getVisit() from *any other page* also return
> >> null, again regardless of whether a visit object was previously
> >> accessible.
> >>
> >> Thanks
> >> Mike Davis
> >>
> >>
> >>
> >> On Thu, 3 May 2007 04:50:29 +0300
> >> "Andreas Andreou" <an...@di.uoa.gr> wrote:
> >>
> >>
> >>> not, that's not correct... session is not invalidated when
> >>> clicking on a DirectLink having the stateful flag set to false
> >>>
> >>> What exactly is the problem you're facing?
> >>>
> >>> On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
> >>>
> >>>> Hi all,
> >>>>
> >>>> I've been asked to do some work on a Tapestry 3 application
> >>>> (unfortunately I can't upgrade it!) and I'm struggling with a
> >>>> DirectLink/session issue. I would like to allow our users to
> >>>> access certain pages without session, yet still be able to return
> >>>> to pages that require a session, without losing any stored state.
> >>>>
> >>>> Is it possible to create a Tapestry app that allows a user to do
> >>>> the following?
> >>>> - open a page that creates and uses a visit object
> >>>> - click a DirectLink with the stateful flag set to false
> >>>> - go back to the first page and use the original visit object
> >>>> again
> >>>>
> >>>> Is it correct to say that once a DirectLink is clicked with the
> >>>> stateful flag set to false, any session data associated with that
> >>>> user's session is invalidated?
> >>>>
> >>>> Thanks
> >>>> Mike Davis
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 3 DirectLink and stateful
Posted by Richard Kirby <rb...@capdm.com>.
Hi Mike,
I think you will find that the cookie used for session tracking is
actually generated by the servlet engine
(Tomcat/Jetty/Weblogic/whatever) and nothing to do with Tapestry.
However, since cookies are nothing but HTTP header lines, you could
always use a Filter to hack the cookie header line. Alternatively, if
you are using mod_proxy to hook your apache to your servlet engine, look
into using ProxyPassReverseCookiePath and ProxyPassReverseCookieDomain.
Cheers
Richard
Mike Davis wrote:
> Hi,
>
> As it turns out, the problem is actually that I've used Apache's
> mod_rewrite to transparently eliminate the context part of the path
> ('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the context
> as part of the cookie's path ...
>
> Is there a way to setup Tapestry so that it will set up the cookie path
> without the context (or with an alternate path)? I have other
> applications on the same app server, so I still need to keep the apps
> in seperate contexts.
>
> I have taken a look in the code and I suppose I could simply hack it
> until it works, but obviously I'm hoping that it's possible just using
> a config file.
>
> Thanks
> Mike Davis
>
>
> On Thu, 3 May 2007 08:47:10 +0200
> Mike Davis <md...@lookhere.co.za> wrote:
>
>
>> Hi,
>>
>> The problem is that I have a page that I'd like users to be able to
>> access with or without a session. This works fine, but calling
>> getVisit() on that page returns null whether or not the user
>> previously had an accessible visit object. Once a user has been to
>> that page, calls to getVisit() from *any other page* also return null,
>> again regardless of whether a visit object was previously accessible.
>>
>> Thanks
>> Mike Davis
>>
>>
>>
>> On Thu, 3 May 2007 04:50:29 +0300
>> "Andreas Andreou" <an...@di.uoa.gr> wrote:
>>
>>
>>> not, that's not correct... session is not invalidated when clicking
>>> on a DirectLink having the stateful flag set to false
>>>
>>> What exactly is the problem you're facing?
>>>
>>> On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I've been asked to do some work on a Tapestry 3 application
>>>> (unfortunately I can't upgrade it!) and I'm struggling with a
>>>> DirectLink/session issue. I would like to allow our users to
>>>> access certain pages without session, yet still be able to return
>>>> to pages that require a session, without losing any stored state.
>>>>
>>>> Is it possible to create a Tapestry app that allows a user to do
>>>> the following?
>>>> - open a page that creates and uses a visit object
>>>> - click a DirectLink with the stateful flag set to false
>>>> - go back to the first page and use the original visit object
>>>> again
>>>>
>>>> Is it correct to say that once a DirectLink is clicked with the
>>>> stateful flag set to false, any session data associated with that
>>>> user's session is invalidated?
>>>>
>>>> Thanks
>>>> Mike Davis
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 3 DirectLink and stateful
Posted by Mike Davis <md...@lookhere.co.za>.
Hi,
As it turns out, the problem is actually that I've used Apache's
mod_rewrite to transparently eliminate the context part of the path
('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the context
as part of the cookie's path ...
Is there a way to setup Tapestry so that it will set up the cookie path
without the context (or with an alternate path)? I have other
applications on the same app server, so I still need to keep the apps
in seperate contexts.
I have taken a look in the code and I suppose I could simply hack it
until it works, but obviously I'm hoping that it's possible just using
a config file.
Thanks
Mike Davis
On Thu, 3 May 2007 08:47:10 +0200
Mike Davis <md...@lookhere.co.za> wrote:
> Hi,
>
> The problem is that I have a page that I'd like users to be able to
> access with or without a session. This works fine, but calling
> getVisit() on that page returns null whether or not the user
> previously had an accessible visit object. Once a user has been to
> that page, calls to getVisit() from *any other page* also return null,
> again regardless of whether a visit object was previously accessible.
>
> Thanks
> Mike Davis
>
>
>
> On Thu, 3 May 2007 04:50:29 +0300
> "Andreas Andreou" <an...@di.uoa.gr> wrote:
>
> > not, that's not correct... session is not invalidated when clicking
> > on a DirectLink having the stateful flag set to false
> >
> > What exactly is the problem you're facing?
> >
> > On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
> > >
> > > Hi all,
> > >
> > > I've been asked to do some work on a Tapestry 3 application
> > > (unfortunately I can't upgrade it!) and I'm struggling with a
> > > DirectLink/session issue. I would like to allow our users to
> > > access certain pages without session, yet still be able to return
> > > to pages that require a session, without losing any stored state.
> > >
> > > Is it possible to create a Tapestry app that allows a user to do
> > > the following?
> > > - open a page that creates and uses a visit object
> > > - click a DirectLink with the stateful flag set to false
> > > - go back to the first page and use the original visit object
> > > again
> > >
> > > Is it correct to say that once a DirectLink is clicked with the
> > > stateful flag set to false, any session data associated with that
> > > user's session is invalidated?
> > >
> > > Thanks
> > > Mike Davis
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 3 DirectLink and stateful
Posted by Mike Davis <md...@lookhere.co.za>.
Hi,
The problem is that I have a page that I'd like users to be able to
access with or without a session. This works fine, but calling
getVisit() on that page returns null whether or not the user
previously had an accessible visit object. Once a user has been to that
page, calls to getVisit() from *any other page* also return null,
again regardless of whether a visit object was previously accessible.
Thanks
Mike Davis
On Thu, 3 May 2007 04:50:29 +0300
"Andreas Andreou" <an...@di.uoa.gr> wrote:
> not, that's not correct... session is not invalidated when clicking
> on a DirectLink having the stateful flag set to false
>
> What exactly is the problem you're facing?
>
> On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
> >
> > Hi all,
> >
> > I've been asked to do some work on a Tapestry 3 application
> > (unfortunately I can't upgrade it!) and I'm struggling with a
> > DirectLink/session issue. I would like to allow our users to
> > access certain pages without session, yet still be able to return to
> > pages that require a session, without losing any stored state.
> >
> > Is it possible to create a Tapestry app that allows a user to do the
> > following?
> > - open a page that creates and uses a visit object
> > - click a DirectLink with the stateful flag set to false
> > - go back to the first page and use the original visit object again
> >
> > Is it correct to say that once a DirectLink is clicked with the
> > stateful flag set to false, any session data associated with that
> > user's session is invalidated?
> >
> > Thanks
> > Mike Davis
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 3 DirectLink and stateful
Posted by Andreas Andreou <an...@di.uoa.gr>.
not, that's not correct... session is not invalidated when clicking on a
DirectLink having the stateful flag set to false
What exactly is the problem you're facing?
On 5/3/07, Mike Davis <md...@lookhere.co.za> wrote:
>
> Hi all,
>
> I've been asked to do some work on a Tapestry 3 application
> (unfortunately I can't upgrade it!) and I'm struggling with a
> DirectLink/session issue. I would like to allow our users to
> access certain pages without session, yet still be able to return to
> pages that require a session, without losing any stored state.
>
> Is it possible to create a Tapestry app that allows a user to do the
> following?
> - open a page that creates and uses a visit object
> - click a DirectLink with the stateful flag set to false
> - go back to the first page and use the original visit object again
>
> Is it correct to say that once a DirectLink is clicked with the
> stateful flag set to false, any session data associated with that
> user's session is invalidated?
>
> Thanks
> Mike Davis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
Re: Tapestry 3 DirectLink and stateful
Posted by Robert Zeigler <ro...@scazdl.org>.
On May 2, 2007, at 5/24:45 PM , Mike Davis wrote:
> Hi all,
>
> I've been asked to do some work on a Tapestry 3 application
> (unfortunately I can't upgrade it!) and I'm struggling with a
> DirectLink/session issue. I would like to allow our users to
> access certain pages without session, yet still be able to return to
> pages that require a session, without losing any stored state.
>
Yes, this is possible.
> Is it possible to create a Tapestry app that allows a user to do the
> following?
> - open a page that creates and uses a visit object
> - click a DirectLink with the stateful flag set to false
> - go back to the first page and use the original visit object again
>
Yup, fine.
> Is it correct to say that once a DirectLink is clicked with the
> stateful flag set to false, any session data associated with that
> user's session is invalidated?
>
No, that's not the case. If the stateful flag is true, and your user
doesn't have a session, or the session was newly created, tapestry
will complain. But if you have a session already and you click on a
direct link with stateful=false, tapestry will keep on chugging
merrily along.
That said, if your page is really supposed to be accessible
"stateless", you might consider implementing IExternalPage and using
an external link, instead; then you avoid having to worry about
statefulness altogether.
Robert
> Thanks
> Mike Davis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org