I finally found a part of the problem origin.
The problem occurs on IE but not on FireFox.
And the HistoryImplIE6.getLocationHash() seems to be bugged.
It does a href.lastIndexOf("#") instead of href.indexOf("#") like
HistoryImplMozilla.nativeUpdate(String).
This explains why a wrong dispatching occurs on IE.
Nevertheless, it does not explain why only the first # is encoded in
%23...
The code seems right in HistoryImpl :
protected native String encodeFragment(String fragment) /*-{
// encodeURI() does *not* encode the '#' character.
return encodeURI(fragment).replace("#", "%23");
}-*/;
The bug of the lastIndexOf is really a bug ?
Has it already been fixed in further release ?
Why only the first # has been replaced ?
If there are gwt developpers around, their help would be
appreciated :)
Regards,
Jordan
On 26 jan, 09:42, Jordan Durieux <[email protected]> wrote:
> It seems that History.newItem(String, boolean) only changes the first
> # in %23.
> Where can I find the source code of History ? (it's in the
> com.google.gwt.user.client package)
>
> Regards,
> Jordan
>
> On 25 jan, 14:05, Jordan Durieux <[email protected]> wrote:
>
> > Hi,
>
> > I have a liltle problem with URL encoding with GWT (1.7.1).
>
> > I have a search page with few TextBox in it.
> > When I fill in a textBox with "foo#bar" (and validate the form) the
> > URL is right => "myParam=foo%23bar" (or maybe wrong since
> > URL.encode(String) should not encode '#')
> > When I fill in the textBox with "foo##bar" the URL is wrong =>
> > "myParam=foo%23#bar"
>
> > The problem is when GWT tries to dispatch the request to the
> > corresponding view it fails !
> > Let's have a look at the full (wrong)
> > URL...http://myServ:myPort/myApp/#myView/search/myParam=foo%23#bar
>
> > GWT searches the lastIndexOf('#') (cf app.nocache.js) and finally try
> > to dispatch to the view "bar" instead of "myView".
>
> > Why only the first '#' is encoded ?
> > How it is encoded ?
>
> > Does someone have a solution for this ?
>
> > Regards,
> > Jordan
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.