public class QueryString extends Object
| Constructor and Description |
|---|
QueryString() |
| Modifier and Type | Method and Description |
|---|---|
static String |
create(Map<String,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 HashMap<String,String> |
parseQueryString(String s) |
static HashMap<String,String> |
parseQueryString(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 String create(Map<String,String> map)
map - public static HashMap<String,String> parseQueryString(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 pairsIllegalArgumentException - if the query string
is invalidCopyright © 2007-2020. All Rights Reserved.