Parsing query strings on Android

前端 未结 25 1386
时光说笑
时光说笑 2020-11-22 17:41

Java EE has ServletRequest.getParameterValues().

On non-EE platforms, URL.getQuery() simply returns a string.

What\'s the normal way to properly parse the qu

25条回答
  •  天涯浪人
    2020-11-22 17:55

    For a servlet or a JSP page you can get querystring key/value pairs by using request.getParameter("paramname")

    String name = request.getParameter("name");
    

    There are other ways of doing it but that's the way I do it in all the servlets and jsp pages that I create.

提交回复
热议问题