What is the equivalent to parse_str in java [duplicate]
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:
- 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. - 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)
精彩评论