svetlo / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

PlaceManager.revealCurrentPlace() does not work well on Firefox containing backward slash #430

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Found in GWT Release (e.g. 2.4.0, 2.5.0 RC): 2.4.0, 2.5.0 RC

Encountered on OS / Browser (e.g. WinXP, IE8-9, FF7): Win7/Firefox 10-14.0

Detailed description (please be as specific as possible):

Here is an example parameter below.
http://localhost:8080/#somepage;param1=hello/bye;param2=kudos

For all browsers, this will normally go to the 'somepage' presenter.
For Firefox, this will go to the default presenter.

You can see on the workaround I did for this below.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

Workaround if you have one:

I did an override on the function

    @Override
    public void revealCurrentPlace() {
        if(Window.Navigator.getUserAgent().contains("Firefox")) {
            String[] currentUrl = History.getToken().split(";");
            PlaceRequest currentPlace = new PlaceRequest(currentUrl[0]);

            for(String param : currentUrl) {
                // skip the first index
                if(currentUrl[0].equals(param)) continue;

                param = param.replaceAll("/", URL.encodeQueryString("/"));
                currentPlace.with(param.split("=")[0], param.split("=")[1]);
            }
            super.revealPlace(currentPlace);
        } else {
            super.revealCurrentPlace();
        }
    }

Original issue reported on code.google.com by aki.kub...@gmail.com on 25 Jul 2012 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by goudreau...@gmail.com on 27 Nov 2012 at 2:44