request

request.getQueryString()是什么意思  

request.getQueryString()就是获取查询字符串

比如客户端发送

http://localhost/test.do?a=b&c=d&e=f

通过request.getQueryString()得到的是

a=b&c=d&e=f

查API如下

Request.getQueryString()

Syntax

Request.getQueryString()

Returns

The query string corresponding to the current client request.

原因就是我将request.getQueryString()写到文件中当日志,怪我对这个方法理解不透,回来好好反省一下,查了api,写了这个方法:

api第一句:Returns the query string that is contained in the request URL after the path,这就说明它只对get方法抛的数据有效。post方法传的参数getQueryString将什么都得不到。

原文地址:https://www.cnblogs.com/panxuejun/p/6704409.html