request.getQueryString()

The query string consists of the parameters following the URL. For example, if the client's browser was directed at http://servername/webname/pagename.csp?paramName=paramValue, the query string would be paramName=paramValue.
ok,明白了,本质就是获取带参数查询。

 

String queryString = request.getQueryString();

queryString = new String(queryString.getBytes("ISO-8859-1"));

String str = queryString.replaceAll("[\\p(ASCII)]","");

String encode_cn = URLEncoder.encode(str,"gbk");

queryString = queryString.replaceAll(str,encode_cn);

 

 

Returns the query string that is contained in the request URL after the path,

post方法传的参数,getQueryString()得不到,

它只对get方法得到的数据有效。

 

你可能感兴趣的:(request)