GWT: Capturing URL parameters in GET request

后端 未结 4 1320
渐次进展
渐次进展 2020-12-13 17:13

I need to build a GWT application that will be called by an external application with specific URL parameters.

For example:

http://www.somehost.com/com.app

4条回答
  •  旧时难觅i
    2020-12-13 17:50

    Try,

    String value = com.google.gwt.user.client.Window.Location.getParameter("orderId");
    // parse the value to int
    

    P.S. GWT can invoke native javascript which means if javascript can do the stuff, GWT can do it too; e.g. in GWT, you can write

    public static native void alert(String msg)
    /*-{
     $wnd.alert("Hey I am javascript");
    }-*/;
    

    In this case, you can even use existing javascript lib to extract param's value in the querystring.

提交回复
热议问题