1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| import java.util.HashMap;
import com.google.gwt.core.client.GWT;
public class GWTUtils {
public static native String getParamString() /*-{
return $wnd.location.search;
}-*/;
public static HashMap<String, String> parseParamString(String string) {
String[] ray = string.substring(1, string.length()).split("&");
HashMap<String, String> map = new HashMap<String, String>();
for (int i = 0; i < ray.length; i++) {
GWT.log("ray[" + i + "]=" + ray[i], null);
String[] substrRay = ray[i].split("=");
map.put(substrRay[0], substrRay[1]);
}
return map;
}
//redirige le browser sur l'url donnée
public static native void redirect(String url)/*-{
$wnd.location = url;
}-*/;
} |