GWT: Capturing URL parameters in GET request

后端 未结 4 1313
渐次进展
渐次进展 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条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 17:47

    GWT has a facility to get params from the URL:

    String value = Window.Location.getParameter("param");
    

    Make sure your URLs are in the form of:

    http://app.com/?param=value#place instead of http://app.com/#place¶m=value

    In order to get all params in a map, use:

    Map> map = Window.Location.getParameterMap();
    

提交回复
热议问题