开发者

What is the equivalent to parse_str in java [duplicate]

开发者 https://www.devze.com 2023-03-07 01:13 出处:网络
This question already 开发者_JAVA百科has answers here: Closed 11 years ago. Possible Duplicate: Parsing query strings in Java
This question already 开发者_JAVA百科has answers here: Closed 11 years ago.

Possible Duplicate:

Parsing query strings in Java

PHP has parse_str(), is there an equivalent function that does the same thing in java?


PHPs parse_str has two modes of operation:

  1. If given a single argument, parse_str will set parameters as variables in the current scope. For this mode of operation, there is no equivalent in Java.
  2. If given two arguments, the second argument must be an array which will be populated with the query string parameters/values. For an equivalent in Java, see this answer on parsing query strings in Java.


You can use the ServletRequest object's getParameter method. http://download.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html)

0

精彩评论

暂无评论...
验证码 换一张
取 消