tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikaël Cluseau <n...@nwrk.dyndns.org>
Subject Re: [DISCUSS] Release 3.0.3
Date Wed, 09 Mar 2005 22:33:46 GMT
I would add a fix in the DataSqueezer: the current implementation allow
Strings like "abc&sp=def" directly in the URL, which creates a second
parameter where only one is expected.

This is very inconvenient when you squeeze callback URLs (I have a
RedirectCallback that squeezes to R{url}). The bug is not obvious (I
first tought the browser was "pretty printing" the URL) as the "?" is
not considered a parameter so, if you have
Login.tap?sp=R/List.tap?sp=1&sp=2, the callback's URL becomes
"/List.tap?sp=1" and you have a second parameter to your Login page...

I think the correct way of encoding parameters is :

...
import java.net.URLEncoder;
import java.net.URLDecoder;
...
public class DataSqueezer {
...
    public String squeeze(Object data) throws IOException
    {
        ISqueezeAdaptor adaptor;

        if (data == null)
            return NULL_PREFIX;

        adaptor = (ISqueezeAdaptor) _adaptors.getAdaptor(data.getClass());

        return URLEncoder.encode(adaptor.squeeze(this, data),"UTF-8");
    }
...
    public Object unsqueeze(String rawString) throws IOException
    {
        ISqueezeAdaptor adaptor = null;

        String string = URLDecoder.decode(rawString, "UTF-8");

        if (string.equals(NULL_PREFIX))
            return null;

        int offset = string.charAt(0) - FIRST_ADAPTOR_OFFSET;

        if (offset >= 0 && offset < _adaptorByPrefix.length)
            adaptor = _adaptorByPrefix[offset];

        // If the adaptor is not otherwise recognized, the it is simply
        // an encoded String (the StringAdaptor may not have added
        // a prefix).

        if (adaptor == null)
            return string;

        // Adaptor should never be null, because we always supply
        // an adaptor for String

        return adaptor.unsqueeze(this, string);
    }
...
}

I use UTF-8 because it is specified by the W3C, so there is no need to
let it be configured. Would'nt hurt too...

Le dimanche 06 mars 2005 à 14:46 -0800, Paul Ferraro a écrit :
> I would like to propose a 3.0.3 release that would contain fixes for the 
> following issues (I've added 2 more):
> 
> 1.) TAPESTRY-238 - bug in DatePicker patch from 3.0.2 that prevents 
> calendar window from closing
> 2.) TAPESTRY-230 - JanitorThread fix in 3.0.2 is incomplete
> 3.) TAPESTRY-277 - DatePicker onchange event fires when date does not change
> 4.) TAPESTRY-255 - Fix for ValidationStrings_zh_TW.properties
> 
> What do people think?
> 
> Erik - yes, I'll volunteer to manage a 3.0.3 release if we decide it's 
> in order.  I'd like to gather some more feedback before I check-in fixes 
> for these issues and start the voting process.
> 
> Paul
> 
> Erik Hatcher wrote:
> 
> > Paul - are you volunteering to be a release manager on such a 
> > release?  I think it would help Howard dramatically if others could 
> > jump in and push through these types of things.
> >
> > For the record, I'm +1 on a 3.0.3 release with these two fixes made.
> >
> >     Erik
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 

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


Mime
View raw message