public class QueryString
extends java.lang.Object
| Constructor and Description |
|---|
QueryString() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
create(java.util.Map<java.lang.String,java.lang.String> map)
Encode the map as a query string, suitable for storing
in w:/sdtPr/w:tag
Note that if you intend to use unmarshalString on this,
you'll first need to encode the '&' as '&'
|
static java.util.HashMap<java.lang.String,java.lang.String> |
parseQueryString(java.lang.String s) |
static java.util.HashMap<java.lang.String,java.lang.String> |
parseQueryString(java.lang.String s,
boolean lax)
Parses a query string passed from the client to the
server and builds a
HashTable object
with key-value pairs. |
public static java.lang.String create(java.util.Map<java.lang.String,java.lang.String> map)
map - public static java.util.HashMap<java.lang.String,java.lang.String> parseQueryString(java.lang.String s)
public static java.util.HashMap<java.lang.String,java.lang.String> parseQueryString(java.lang.String s,
boolean lax)
HashTable object
with key-value pairs.
The query string should be in the form of a string
packaged by the GET or POST method, that is, it
should have key-value pairs in the form key=value,
with each pair separated from the next by a & character.
A key can appear more than once in the query string with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the query string.
When the keys (only - *not* values) are moved into the hashtable, any + characters are converted to spaces, and characters sent in hexadecimal notation (like %xx) are converted to ASCII characters. This method adapted from Java sources
s - a string containing the query to be parsedHashTable object built
from the parsed key-value pairsjava.lang.IllegalArgumentException - if the query string
is invalidCopyright © 2007–2023. All rights reserved.