working with Query String in GWT

前端 未结 4 834
闹比i
闹比i 2021-01-13 06:23

I have to created a dynamic URLcontaining the user id and email parameters, which will direct to sign up form in my GWT application. I want to set and get the parameters in

4条回答
  •  灰色年华
    2021-01-13 06:45

    Don't think there's a simple tokenized query string parser in GWT. But you can get the raw query string by using:

    String queryString = Window.Location.getQueryString();
    

    Parse it any way you like. I use it like this to set debug flags etc.:

    boolean debugMode = Window.Location.getQueryString().indexOf("debug=true") >= 0;
    

    Note that changing values in the query part of the url (between the ? and the #) will reload the page. While changing the "hash part" of the url (anything after the #) will not reload the page. Which is why the com.google.gwt.user.client.History uses the hash part.

提交回复
热议问题