java后台获取URL带参demo

URL:http://aos.wall.youmi.net/v2/check_fb_sig?order=YM130402cygr_UTb42&app=30996ced018a2a5e&ad=KC%E7%BD%91%E7%BB%9C%E7%94%B5%E8%AF%9D&user=1141058&device=50ead626ae6e&chn=0&points=7&time=1364890524&sig=15b3dfe0&adid=100&pkg=abc
java后台获取URL带参demo
文章图片

获取到的parameter为:
order=YM130402cygr_UTb42&app=30996ced018a2a5e&ad=KC%E7%BD%91%E7%BB%9C%E7%94%B5%E8%AF%9D&user=1141058&
device=50ead626ae6e&chn=0&points=7&time=1364890524&sig=15b3dfe0&adid=100&pkg=abc


java后台获取URL带参demo
文章图片


SysConfigUtil.getQueryParams(parameter):如下:


public static Map getQueryParams(String url) { try { Map params = new HashMap(); for (String param : url.split("&")) { String[] pair = param.split("="); String key = URLDecoder.decode(pair[0], "UTF-8"); String valuehttps://www.it610.com/article/= ""; if (pair.length > 1) { value = https://www.it610.com/article/URLDecoder.decode(pair[1],"UTF-8"); } params.put(key, value); }return params; } catch (UnsupportedEncodingException ex) { throw new AssertionError(ex); } }


【java后台获取URL带参demo】转载于:https://www.cnblogs.com/ipetergo/p/6840041.html

    推荐阅读