PDA

View Full Version : I rewrite url with a new parameter "locale=fr" but the url address seems not change



vicre
26 Apr 2011, 7:29 PM
I rewrite a url with a new parameter "locale=fr" but the url address seems not work
the original url is http://127.0.0.1:8888/Administrator.html (http://127.0.0.1:8888/Administrator.html?gwt.codesvr=127.0.0.1:9997)
after using the following method (setLocaleOnLoad("fr")),it should be http://127.0.0.1:8888/Administrator.html?locale=fr (http://127.0.0.1:8888/Administrator.html?locale=de&gwt.codesvr=127.0.0.1:9997) , but it keeps the original url http://127.0.0.1:8888/Administrator.html (http://127.0.0.1:8888/Administrator.html?gwt.codesvr=127.0.0.1:9997) . what is wrong ? thanks ....

public void setLocaleOnLoad(String locale) {

if (null != locale ) {
Location.createUrlBuilder().removeParameter("locale");
UrlBuilder builder = Location.createUrlBuilder().setParameter("locale", locale);
String newUrl = builder.buildString();
Window.Location.replace(newUrl);
}
Window.Location.reload();
// XDOM.reload();
}

javafreshman
16 Nov 2011, 10:14 PM
seems no need to call Window.Location.reload();