Sam, thanks very much for the quick reply. 

I realized the DataSqueezer won't solve my problem because it only applies to 
forms. But I was able to shorten my URLs by passing the object's primary key to 
the DirectLink handler instead of the object itself. This fixed my problem.

Regarding using DataSqueezer in my forms, I coded up the DataSqueezer as best I 
could using the sample code at http://wiki.apache.org/tapestry/DataSqueezer, 
but it doesn't seem to be taking effect in my app. I've registered the 
implementation with Hivemind, but I don't know what else to do to make it work. 
Like many of the Tapestry docs, this sample isn't quite completely explained. 
It would really help if there were complete samples to deal with all the @For 
options: keyExpression, converter, primaryKeys and SqueezeAdaptor/DataSqueezer.

Thanks again.
Julian

----- Original Message ----
From: Sam Gendler <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Sunday, October 29, 2006 3:36:05 PM
Subject: Re: Problem with too long urls

Generally, this occurs because Tapestry has been forced to serialize
an object, or a collection of objects, to the form in order ensure
consistency when the form is rewound.  You can prevent this by
defining a 'DataSqueezer' for your entities which will allow you to
send a simple primary key from which the object can be loaded, rather
than having to serialize the entire state of the object to the
browser.  Also, wherever possible, make your loops and conditionals
volatile, so that the collection that is the source of the loop
doesn't have to get serialized at all.  Of course, this runs the risk
of introducing stale link errors, so must be used judiciously.  You
will surely be able to determine the constructs which need to be
modified by taking a look at the source of your form (or the query
string params) and you'll see long uuencoded text strings which are
serialized objects.

There is a page describing the DataSqueezer concept on the tapestry
wiki.  I've also attached my EnumSqueezer as an example.  You'll also
need the entries equivalent to the following in your hivemodule.xml
file.

    <service-point id="EnumSqueezer"
        interface="org.apache.tapestry.util.io.SqueezeAdaptor">
        <invoke-factory>
            <construct class="com.euroclick.gb.web.utils.EnumSqueezer"/>
        </invoke-factory>
    </service-point>

    <contribution configuration-id="tapestry.data.SqueezeAdaptors">
        <adaptor object="service:EnumSqueezer"/>
    </contribution>


On 10/29/06, Julian Sinai <[EMAIL PROTECTED]> wrote:
> Hi--I'm having a problem with Tapestry URLs from a DirectLink in my 
> application. It seems to only be a problem in Internet Explorer. My guess is 
> the URLs are too long. I've tried the documented advice to use the DirectLink 
> service encoder, but that doesn't shorten the session information that gets 
> added to the query string. I've also tried the FormLinkRenderer from the 
> Tapestry Deli site, but that didn't work at all. I've also tried 
> @Persist("client") technique but I don't think I understand it properly 
> because it broke my app.
>
> I don't know if this makes any difference, but the DirectLink in question is 
> inside a custom component, although it's a very simple one. Also, I'm using 
> Tap 4.0.2.
>
> Any advice is greatly appreciated.
> Thanks,
> Julian
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to