You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stijn Christiaens <st...@vub.ac.be> on 2006/01/18 12:50:17 UTC

ActionLink and DirectLink

Hello everybody,

previously I used ActionLink to do my dirty work, but it seems that this
is not such a safe approach. In transferring to DirectLink I am a little
bit unsure about how to continue.
I use my DirectLink with a listener and parameters. Unfortunately, the
parameter Object I have to pass is too big to be serialized in the URL
(the DirectLink does nothing because the URL is too long). So I probably
have to pass some kind of key (no database key as it is an Object in
edit, so not saved yet and not to be saved yet either) as parameter.
Where do I store the Object that is associated with this key?
Do I place it on the Component or somewhere on something I can access
using IRequestCycle?

Thanks in advance!

Ciao,

Stijn


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


Re: ActionLink and DirectLink

Posted by Norbert Sándor <de...@erinors.com>.
No. Those are submitted in a POST request, but not in the URL, the URL will 
remain short. Of course you should be careful, because in this case the 
hidden fields may grow very large, which may become a performance 
bottleneck.
I didn't follow the discussion but if your page works with ActionLinks, then 
it is probably easy to replace them with LinkSubmits and embed the 
components in a Form. You can use several framework components which support 
forms like If, For, etc. to optimize your pages.

If you choose to use DirectLinks (which is probably better if you don't need 
forms) then you can store the objects in the HTTP session (in the Visit 
object or a custom session scoped ASO, see 
http://jakarta.apache.org/tapestry/UsersGuide/state.html#state.aso for more 
info).

BR,
Norbi

----- Original Message ----- 
From: "Stijn Christiaens" <st...@vub.ac.be>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, January 18, 2006 1:20 PM
Subject: Re: ActionLink and DirectLink


> That sounds like a good idea. But is the data in these fields not also
> passed in the URL?
>
> On Wed, 2006-01-18 at 12:59 +0100, Norbert Sándor wrote:
>> Maybe embed those components in a Form...
>> So big objects will be stored in hidden fields.
>>
>> BR,
>> Norbi
>>
>> ----- Original Message ----- 
>> From: "Stijn Christiaens" <st...@vub.ac.be>
>> To: "Tapestry users" <ta...@jakarta.apache.org>
>> Sent: Wednesday, January 18, 2006 12:50 PM
>> Subject: ActionLink and DirectLink
>>
>>
>> > Hello everybody,
>> >
>> > previously I used ActionLink to do my dirty work, but it seems that 
>> > this
>> > is not such a safe approach. In transferring to DirectLink I am a 
>> > little
>> > bit unsure about how to continue.
>> > I use my DirectLink with a listener and parameters. Unfortunately, the
>> > parameter Object I have to pass is too big to be serialized in the URL
>> > (the DirectLink does nothing because the URL is too long). So I 
>> > probably
>> > have to pass some kind of key (no database key as it is an Object in
>> > edit, so not saved yet and not to be saved yet either) as parameter.
>> > Where do I store the Object that is associated with this key?
>> > Do I place it on the Component or somewhere on something I can access
>> > using IRequestCycle?
>> >
>> > Thanks in advance!
>> >
>> > Ciao,
>> >
>> > Stijn
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>> >
>> >
>> >
>> >
>> >
>> > -- 
>> > No virus found in this incoming message.
>> > Checked by AVG Free Edition.
>> > Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006. 
>> > 01.
>> > 18.
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006. 01. 
> 18.
> 


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


Re: ActionLink and DirectLink

Posted by Stijn Christiaens <st...@vub.ac.be>.
That sounds like a good idea. But is the data in these fields not also
passed in the URL?

On Wed, 2006-01-18 at 12:59 +0100, Norbert Sándor wrote:
> Maybe embed those components in a Form...
> So big objects will be stored in hidden fields.
> 
> BR,
> Norbi
> 
> ----- Original Message ----- 
> From: "Stijn Christiaens" <st...@vub.ac.be>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, January 18, 2006 12:50 PM
> Subject: ActionLink and DirectLink
> 
> 
> > Hello everybody,
> >
> > previously I used ActionLink to do my dirty work, but it seems that this
> > is not such a safe approach. In transferring to DirectLink I am a little
> > bit unsure about how to continue.
> > I use my DirectLink with a listener and parameters. Unfortunately, the
> > parameter Object I have to pass is too big to be serialized in the URL
> > (the DirectLink does nothing because the URL is too long). So I probably
> > have to pass some kind of key (no database key as it is an Object in
> > edit, so not saved yet and not to be saved yet either) as parameter.
> > Where do I store the Object that is associated with this key?
> > Do I place it on the Component or somewhere on something I can access
> > using IRequestCycle?
> >
> > Thanks in advance!
> >
> > Ciao,
> >
> > Stijn
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> > -- 
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006. 01. 
> > 18.
> >
> > 
> 
> 
> ---------------------------------------------------------------------
> 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: ActionLink and DirectLink

Posted by Norbert Sándor <de...@erinors.com>.
Maybe embed those components in a Form...
So big objects will be stored in hidden fields.

BR,
Norbi

----- Original Message ----- 
From: "Stijn Christiaens" <st...@vub.ac.be>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, January 18, 2006 12:50 PM
Subject: ActionLink and DirectLink


> Hello everybody,
>
> previously I used ActionLink to do my dirty work, but it seems that this
> is not such a safe approach. In transferring to DirectLink I am a little
> bit unsure about how to continue.
> I use my DirectLink with a listener and parameters. Unfortunately, the
> parameter Object I have to pass is too big to be serialized in the URL
> (the DirectLink does nothing because the URL is too long). So I probably
> have to pass some kind of key (no database key as it is an Object in
> edit, so not saved yet and not to be saved yet either) as parameter.
> Where do I store the Object that is associated with this key?
> Do I place it on the Component or somewhere on something I can access
> using IRequestCycle?
>
> Thanks in advance!
>
> Ciao,
>
> Stijn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006. 01. 
> 18.
>
> 


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


Re: ActionLink and DirectLink

Posted by Robert Zeigler <ro...@scazdl.org>.
Yes.
Write a custom squeeze adapter implementation to handle your objects.

Robert

Martin Strand wrote:

> I often find myself doing this, stuffing an object id into a 
> DirectLink or  storing an object id in a persistent page property and 
> then recreating the  object in pageBeginRender. Can't Tapestry handle 
> this conversion instead?  I'm thinking of something like the 
> "converter" parameter in the For  component.
>
> On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey 
> <pa...@adelphia.net>  wrote:
>
>>     A fairly standard approach is to not send the object out on the
>> directlink, but instead send out some sort of uniquely identifiable 
>> key  and
>> the pull the object back out of persistent storage as the first  
>> operation in
>> your direct link.
>>
>>     If you're talking about DB objects, then putting the unique key on
>> the outbound URL and then reloading it in the listener is certainly the
>> easiest approach (although not without security implications because  
>> you're
>> opening a door for the outside world into your key structure).
>>
>>     Alternately, if it's something that doesn't have a "natural" storage
>> mode or key, you can just wrap it in an object with a key then stuff 
>> it  in a
>> server-side linkedhashmap that you then store in the client session. The
>> reason you probably want to use a linked hash map is to "forget" about
>> objects you stuffed in there a while ago so that you don't end up 
>> with  2,000
>> objects cluttering up server side memory when the user is only likely 
>> to  use
>> the most recent 5 or so of them. In practice, I've found a page 
>> memory  of 10
>> is almost always big enough.
>>
>>     --- Pat
>>
>>> -----Original Message-----
>>> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
>>> Sent: Wednesday, January 18, 2006 3:50 AM
>>> To: Tapestry users
>>> Subject: ActionLink and DirectLink
>>>
>>> Hello everybody,
>>>
>>> previously I used ActionLink to do my dirty work, but it seems that 
>>> this
>>> is not such a safe approach. In transferring to DirectLink I am a 
>>> little
>>> bit unsure about how to continue.
>>> I use my DirectLink with a listener and parameters. Unfortunately, the
>>> parameter Object I have to pass is too big to be serialized in the URL
>>> (the DirectLink does nothing because the URL is too long). So I 
>>> probably
>>> have to pass some kind of key (no database key as it is an Object in
>>> edit, so not saved yet and not to be saved yet either) as parameter.
>>> Where do I store the Object that is associated with this key?
>>> Do I place it on the Component or somewhere on something I can access
>>> using IRequestCycle?
>>>
>>> Thanks in advance!
>>>
>>> Ciao,
>>>
>>> Stijn
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: ActionLink and DirectLink

Posted by Jesse Kuhnert <jk...@gmail.com>.
I think this is precisely what Marcus is addressing with his persistence
library at http://kickstart.sourceforge.net (soon to be showing up on a new
server with new name).

We both agree that this is a repetitive task that can/should be handled by
something.

On 1/18/06, Martin Strand <ma...@entcap.se> wrote:
>
> I often find myself doing this, stuffing an object id into a DirectLink or
> storing an object id in a persistent page property and then recreating the
> object in pageBeginRender. Can't Tapestry handle this conversion instead?
> I'm thinking of something like the "converter" parameter in the For
> component.
>
> On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey <pa...@adelphia.net>
> wrote:
>
> >       A fairly standard approach is to not send the object out on the
> > directlink, but instead send out some sort of uniquely identifiable key
> > and
> > the pull the object back out of persistent storage as the first
> > operation in
> > your direct link.
> >
> >       If you're talking about DB objects, then putting the unique key on
> > the outbound URL and then reloading it in the listener is certainly the
> > easiest approach (although not without security implications because
> > you're
> > opening a door for the outside world into your key structure).
> >
> >       Alternately, if it's something that doesn't have a "natural"
> storage
> > mode or key, you can just wrap it in an object with a key then stuff it
> > in a
> > server-side linkedhashmap that you then store in the client session. The
> > reason you probably want to use a linked hash map is to "forget" about
> > objects you stuffed in there a while ago so that you don't end up with
> > 2,000
> > objects cluttering up server side memory when the user is only likely to
> > use
> > the most recent 5 or so of them. In practice, I've found a page memory
> > of 10
> > is almost always big enough.
> >
> >       --- Pat
> >
> >> -----Original Message-----
> >> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
> >> Sent: Wednesday, January 18, 2006 3:50 AM
> >> To: Tapestry users
> >> Subject: ActionLink and DirectLink
> >>
> >> Hello everybody,
> >>
> >> previously I used ActionLink to do my dirty work, but it seems that
> this
> >> is not such a safe approach. In transferring to DirectLink I am a
> little
> >> bit unsure about how to continue.
> >> I use my DirectLink with a listener and parameters. Unfortunately, the
> >> parameter Object I have to pass is too big to be serialized in the URL
> >> (the DirectLink does nothing because the URL is too long). So I
> probably
> >> have to pass some kind of key (no database key as it is an Object in
> >> edit, so not saved yet and not to be saved yet either) as parameter.
> >> Where do I store the Object that is associated with this key?
> >> Do I place it on the Component or somewhere on something I can access
> >> using IRequestCycle?
> >>
> >> Thanks in advance!
> >>
> >> Ciao,
> >>
> >> Stijn
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: ActionLink and DirectLink

Posted by Robert Zeigler <ro...@scazdl.org>.
It is six of one, half dozen of the other. Except. :)
Once you write the squeezer implemenation and register it, you no longer 
have to think about it.
You reduced the duplicity in your code. :)

Robert

Patrick Casey wrote:

>	His problem as I understand it is a bit less easily resolved than
>that. The default data squeezer has some custom code for dealing with
>primitives and the "pseudo-primitive" string class. When it runs into an
>arbitrary object though, it just serializes it into a byte[] then runs
>base64 encoding over it to produce a legal string.
>
>	With a decent sized object, this serialized object is too big for a
>URL which has a maximum length. So you can't use the default squeezer
>approach to push the object out and get it back.
>
>	One approach that Roger suggested was to write (and register) a
>custom squeezer which "squeezed" a DB object down to its className/key
>combination and then reloaded it from persistent storage during the
>"unsqueeze" operation. His approach sounds like it'd work fine to me, but
>I've generally gone the less sophisticated approach myself and just
>boostrapped my objects in the listeners themselves.
>
>	Six of one, half dozen of the other I suppose,
>
>	--- Pat
>
>  
>
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Raul Raja Martinez
>>Sent: Wednesday, January 18, 2006 10:06 AM
>>To: tapestry-user@jakarta.apache.org
>>Subject: Re: ActionLink and DirectLink
>>
>>Do you mean the DataSqueezer?
>>
>>http://wiki.apache.org/jakarta-tapestry/DataSqueezer
>>
>>
>>
>>Martin Strand wrote:
>>    
>>
>>>I often find myself doing this, stuffing an object id into a DirectLink
>>>or storing an object id in a persistent page property and then
>>>recreating the object in pageBeginRender. Can't Tapestry handle this
>>>conversion instead? I'm thinking of something like the "converter"
>>>parameter in the For component.
>>>
>>>On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey
>>><pa...@adelphia.net> wrote:
>>>
>>>      
>>>
>>>>    A fairly standard approach is to not send the object out on the
>>>>directlink, but instead send out some sort of uniquely identifiable
>>>>key and
>>>>the pull the object back out of persistent storage as the first
>>>>operation in
>>>>your direct link.
>>>>
>>>>    If you're talking about DB objects, then putting the unique key on
>>>>the outbound URL and then reloading it in the listener is certainly the
>>>>easiest approach (although not without security implications because
>>>>you're
>>>>opening a door for the outside world into your key structure).
>>>>
>>>>    Alternately, if it's something that doesn't have a "natural"
>>>>        
>>>>
>>storage
>>    
>>
>>>>mode or key, you can just wrap it in an object with a key then stuff
>>>>it in a
>>>>server-side linkedhashmap that you then store in the client session.
>>>>        
>>>>
>>The
>>    
>>
>>>>reason you probably want to use a linked hash map is to "forget" about
>>>>objects you stuffed in there a while ago so that you don't end up with
>>>>2,000
>>>>objects cluttering up server side memory when the user is only likely
>>>>to use
>>>>the most recent 5 or so of them. In practice, I've found a page memory
>>>>of 10
>>>>is almost always big enough.
>>>>
>>>>    --- Pat
>>>>
>>>>        
>>>>
>>>>>-----Original Message-----
>>>>>From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
>>>>>Sent: Wednesday, January 18, 2006 3:50 AM
>>>>>To: Tapestry users
>>>>>Subject: ActionLink and DirectLink
>>>>>
>>>>>Hello everybody,
>>>>>
>>>>>previously I used ActionLink to do my dirty work, but it seems that
>>>>>          
>>>>>
>>this
>>    
>>
>>>>>is not such a safe approach. In transferring to DirectLink I am a
>>>>>          
>>>>>
>>little
>>    
>>
>>>>>bit unsure about how to continue.
>>>>>I use my DirectLink with a listener and parameters. Unfortunately, the
>>>>>parameter Object I have to pass is too big to be serialized in the URL
>>>>>(the DirectLink does nothing because the URL is too long). So I
>>>>>          
>>>>>
>>probably
>>    
>>
>>>>>have to pass some kind of key (no database key as it is an Object in
>>>>>edit, so not saved yet and not to be saved yet either) as parameter.
>>>>>Where do I store the Object that is associated with this key?
>>>>>Do I place it on the Component or somewhere on something I can access
>>>>>using IRequestCycle?
>>>>>
>>>>>Thanks in advance!
>>>>>
>>>>>Ciao,
>>>>>
>>>>>Stijn
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>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
>  
>



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


RE: ActionLink and DirectLink

Posted by Patrick Casey <pa...@adelphia.net>.
	His problem as I understand it is a bit less easily resolved than
that. The default data squeezer has some custom code for dealing with
primitives and the "pseudo-primitive" string class. When it runs into an
arbitrary object though, it just serializes it into a byte[] then runs
base64 encoding over it to produce a legal string.

	With a decent sized object, this serialized object is too big for a
URL which has a maximum length. So you can't use the default squeezer
approach to push the object out and get it back.

	One approach that Roger suggested was to write (and register) a
custom squeezer which "squeezed" a DB object down to its className/key
combination and then reloaded it from persistent storage during the
"unsqueeze" operation. His approach sounds like it'd work fine to me, but
I've generally gone the less sophisticated approach myself and just
boostrapped my objects in the listeners themselves.

	Six of one, half dozen of the other I suppose,

	--- Pat

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Raul Raja Martinez
> Sent: Wednesday, January 18, 2006 10:06 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Re: ActionLink and DirectLink
> 
> Do you mean the DataSqueezer?
> 
> http://wiki.apache.org/jakarta-tapestry/DataSqueezer
> 
> 
> 
> Martin Strand wrote:
> > I often find myself doing this, stuffing an object id into a DirectLink
> > or storing an object id in a persistent page property and then
> > recreating the object in pageBeginRender. Can't Tapestry handle this
> > conversion instead? I'm thinking of something like the "converter"
> > parameter in the For component.
> >
> > On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey
> > <pa...@adelphia.net> wrote:
> >
> >>     A fairly standard approach is to not send the object out on the
> >> directlink, but instead send out some sort of uniquely identifiable
> >> key and
> >> the pull the object back out of persistent storage as the first
> >> operation in
> >> your direct link.
> >>
> >>     If you're talking about DB objects, then putting the unique key on
> >> the outbound URL and then reloading it in the listener is certainly the
> >> easiest approach (although not without security implications because
> >> you're
> >> opening a door for the outside world into your key structure).
> >>
> >>     Alternately, if it's something that doesn't have a "natural"
> storage
> >> mode or key, you can just wrap it in an object with a key then stuff
> >> it in a
> >> server-side linkedhashmap that you then store in the client session.
> The
> >> reason you probably want to use a linked hash map is to "forget" about
> >> objects you stuffed in there a while ago so that you don't end up with
> >> 2,000
> >> objects cluttering up server side memory when the user is only likely
> >> to use
> >> the most recent 5 or so of them. In practice, I've found a page memory
> >> of 10
> >> is almost always big enough.
> >>
> >>     --- Pat
> >>
> >>> -----Original Message-----
> >>> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
> >>> Sent: Wednesday, January 18, 2006 3:50 AM
> >>> To: Tapestry users
> >>> Subject: ActionLink and DirectLink
> >>>
> >>> Hello everybody,
> >>>
> >>> previously I used ActionLink to do my dirty work, but it seems that
> this
> >>> is not such a safe approach. In transferring to DirectLink I am a
> little
> >>> bit unsure about how to continue.
> >>> I use my DirectLink with a listener and parameters. Unfortunately, the
> >>> parameter Object I have to pass is too big to be serialized in the URL
> >>> (the DirectLink does nothing because the URL is too long). So I
> probably
> >>> have to pass some kind of key (no database key as it is an Object in
> >>> edit, so not saved yet and not to be saved yet either) as parameter.
> >>> Where do I store the Object that is associated with this key?
> >>> Do I place it on the Component or somewhere on something I can access
> >>> using IRequestCycle?
> >>>
> >>> Thanks in advance!
> >>>
> >>> Ciao,
> >>>
> >>> Stijn
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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: Problem with Property Selection

Posted by Subramanian Thangamuthu <su...@yahoo.com>.
Hi...
  
 I am having problem with forgetPage method of IRequestCycle class  in Tapestry 4.0. I am using that method in an listener method of Direct Link. I am able to clear the contents of the specified page when the link is clicked twice. But this doesn't happen when direct link is clicked only once...
 
 I am using the method like this...
        forgetPage(getPage().getPageName());
 
Kindly help me out of this.
 
 Thanks,
 -Subramanian




Problem with Property Selection

Posted by Subramanian Thangamuthu <su...@yahoo.com>.
Hi...
 
 I am having the problem with Property Selection Component in Tapestry 4.0. I am able to get the selected Object in the form listener and in the page render method at reload. But that selected property is not seen  on the page. 
 
 I am using my own Model for the Property Selection where as this works with the StringPropertySelection.
 
 Kindly help me out of this.
 
 Thanks,
 -Subramanian

Re: ActionLink and DirectLink

Posted by Raul Raja Martinez <do...@estudiowebs.com>.
Do you mean the DataSqueezer?

http://wiki.apache.org/jakarta-tapestry/DataSqueezer



Martin Strand wrote:
> I often find myself doing this, stuffing an object id into a DirectLink 
> or storing an object id in a persistent page property and then 
> recreating the object in pageBeginRender. Can't Tapestry handle this 
> conversion instead? I'm thinking of something like the "converter" 
> parameter in the For component.
> 
> On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey 
> <pa...@adelphia.net> wrote:
> 
>>     A fairly standard approach is to not send the object out on the
>> directlink, but instead send out some sort of uniquely identifiable 
>> key and
>> the pull the object back out of persistent storage as the first 
>> operation in
>> your direct link.
>>
>>     If you're talking about DB objects, then putting the unique key on
>> the outbound URL and then reloading it in the listener is certainly the
>> easiest approach (although not without security implications because 
>> you're
>> opening a door for the outside world into your key structure).
>>
>>     Alternately, if it's something that doesn't have a "natural" storage
>> mode or key, you can just wrap it in an object with a key then stuff 
>> it in a
>> server-side linkedhashmap that you then store in the client session. The
>> reason you probably want to use a linked hash map is to "forget" about
>> objects you stuffed in there a while ago so that you don't end up with 
>> 2,000
>> objects cluttering up server side memory when the user is only likely 
>> to use
>> the most recent 5 or so of them. In practice, I've found a page memory 
>> of 10
>> is almost always big enough.
>>
>>     --- Pat
>>
>>> -----Original Message-----
>>> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
>>> Sent: Wednesday, January 18, 2006 3:50 AM
>>> To: Tapestry users
>>> Subject: ActionLink and DirectLink
>>>
>>> Hello everybody,
>>>
>>> previously I used ActionLink to do my dirty work, but it seems that this
>>> is not such a safe approach. In transferring to DirectLink I am a little
>>> bit unsure about how to continue.
>>> I use my DirectLink with a listener and parameters. Unfortunately, the
>>> parameter Object I have to pass is too big to be serialized in the URL
>>> (the DirectLink does nothing because the URL is too long). So I probably
>>> have to pass some kind of key (no database key as it is an Object in
>>> edit, so not saved yet and not to be saved yet either) as parameter.
>>> Where do I store the Object that is associated with this key?
>>> Do I place it on the Component or somewhere on something I can access
>>> using IRequestCycle?
>>>
>>> Thanks in advance!
>>>
>>> Ciao,
>>>
>>> Stijn
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: ActionLink and DirectLink

Posted by Martin Strand <ma...@entcap.se>.
I often find myself doing this, stuffing an object id into a DirectLink or  
storing an object id in a persistent page property and then recreating the  
object in pageBeginRender. Can't Tapestry handle this conversion instead?  
I'm thinking of something like the "converter" parameter in the For  
component.

On Wed, 18 Jan 2006 18:15:24 +0100, Patrick Casey <pa...@adelphia.net>  
wrote:

> 	A fairly standard approach is to not send the object out on the
> directlink, but instead send out some sort of uniquely identifiable key  
> and
> the pull the object back out of persistent storage as the first  
> operation in
> your direct link.
>
> 	If you're talking about DB objects, then putting the unique key on
> the outbound URL and then reloading it in the listener is certainly the
> easiest approach (although not without security implications because  
> you're
> opening a door for the outside world into your key structure).
>
> 	Alternately, if it's something that doesn't have a "natural" storage
> mode or key, you can just wrap it in an object with a key then stuff it  
> in a
> server-side linkedhashmap that you then store in the client session. The
> reason you probably want to use a linked hash map is to "forget" about
> objects you stuffed in there a while ago so that you don't end up with  
> 2,000
> objects cluttering up server side memory when the user is only likely to  
> use
> the most recent 5 or so of them. In practice, I've found a page memory  
> of 10
> is almost always big enough.
>
> 	--- Pat
>
>> -----Original Message-----
>> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
>> Sent: Wednesday, January 18, 2006 3:50 AM
>> To: Tapestry users
>> Subject: ActionLink and DirectLink
>>
>> Hello everybody,
>>
>> previously I used ActionLink to do my dirty work, but it seems that this
>> is not such a safe approach. In transferring to DirectLink I am a little
>> bit unsure about how to continue.
>> I use my DirectLink with a listener and parameters. Unfortunately, the
>> parameter Object I have to pass is too big to be serialized in the URL
>> (the DirectLink does nothing because the URL is too long). So I probably
>> have to pass some kind of key (no database key as it is an Object in
>> edit, so not saved yet and not to be saved yet either) as parameter.
>> Where do I store the Object that is associated with this key?
>> Do I place it on the Component or somewhere on something I can access
>> using IRequestCycle?
>>
>> Thanks in advance!
>>
>> Ciao,
>>
>> Stijn
>>
>>
>> ---------------------------------------------------------------------
>> 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: ActionLink and DirectLink

Posted by Stijn Christiaens <st...@vub.ac.be>.
Thanks! Just the answer I was looking for.

On Wed, 2006-01-18 at 09:15 -0800, Patrick Casey wrote:
> 	A fairly standard approach is to not send the object out on the
> directlink, but instead send out some sort of uniquely identifiable key and
> the pull the object back out of persistent storage as the first operation in
> your direct link.
> 
> 	If you're talking about DB objects, then putting the unique key on
> the outbound URL and then reloading it in the listener is certainly the
> easiest approach (although not without security implications because you're
> opening a door for the outside world into your key structure).
> 
> 	Alternately, if it's something that doesn't have a "natural" storage
> mode or key, you can just wrap it in an object with a key then stuff it in a
> server-side linkedhashmap that you then store in the client session. The
> reason you probably want to use a linked hash map is to "forget" about
> objects you stuffed in there a while ago so that you don't end up with 2,000
> objects cluttering up server side memory when the user is only likely to use
> the most recent 5 or so of them. In practice, I've found a page memory of 10
> is almost always big enough.
> 
> 	--- Pat
> 
> > -----Original Message-----
> > From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
> > Sent: Wednesday, January 18, 2006 3:50 AM
> > To: Tapestry users
> > Subject: ActionLink and DirectLink
> > 
> > Hello everybody,
> > 
> > previously I used ActionLink to do my dirty work, but it seems that this
> > is not such a safe approach. In transferring to DirectLink I am a little
> > bit unsure about how to continue.
> > I use my DirectLink with a listener and parameters. Unfortunately, the
> > parameter Object I have to pass is too big to be serialized in the URL
> > (the DirectLink does nothing because the URL is too long). So I probably
> > have to pass some kind of key (no database key as it is an Object in
> > edit, so not saved yet and not to be saved yet either) as parameter.
> > Where do I store the Object that is associated with this key?
> > Do I place it on the Component or somewhere on something I can access
> > using IRequestCycle?
> > 
> > Thanks in advance!
> > 
> > Ciao,
> > 
> > Stijn
> > 
> > 
> > ---------------------------------------------------------------------
> > 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: ActionLink and DirectLink

Posted by Patrick Casey <pa...@adelphia.net>.
	A fairly standard approach is to not send the object out on the
directlink, but instead send out some sort of uniquely identifiable key and
the pull the object back out of persistent storage as the first operation in
your direct link.

	If you're talking about DB objects, then putting the unique key on
the outbound URL and then reloading it in the listener is certainly the
easiest approach (although not without security implications because you're
opening a door for the outside world into your key structure).

	Alternately, if it's something that doesn't have a "natural" storage
mode or key, you can just wrap it in an object with a key then stuff it in a
server-side linkedhashmap that you then store in the client session. The
reason you probably want to use a linked hash map is to "forget" about
objects you stuffed in there a while ago so that you don't end up with 2,000
objects cluttering up server side memory when the user is only likely to use
the most recent 5 or so of them. In practice, I've found a page memory of 10
is almost always big enough.

	--- Pat

> -----Original Message-----
> From: Stijn Christiaens [mailto:stijn.christiaens@vub.ac.be]
> Sent: Wednesday, January 18, 2006 3:50 AM
> To: Tapestry users
> Subject: ActionLink and DirectLink
> 
> Hello everybody,
> 
> previously I used ActionLink to do my dirty work, but it seems that this
> is not such a safe approach. In transferring to DirectLink I am a little
> bit unsure about how to continue.
> I use my DirectLink with a listener and parameters. Unfortunately, the
> parameter Object I have to pass is too big to be serialized in the URL
> (the DirectLink does nothing because the URL is too long). So I probably
> have to pass some kind of key (no database key as it is an Object in
> edit, so not saved yet and not to be saved yet either) as parameter.
> Where do I store the Object that is associated with this key?
> Do I place it on the Component or somewhere on something I can access
> using IRequestCycle?
> 
> Thanks in advance!
> 
> Ciao,
> 
> Stijn
> 
> 
> ---------------------------------------------------------------------
> 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