public class WebappUtil extends Object
Constructor and Description |
---|
WebappUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
cookieNeedsEncoding(javax.servlet.http.Cookie inCookie)
Trys to determine if the cookie value needs to be encoded according to section 4.1.1 of RFC 6265.
|
static String |
decodeCookieValue(String inEncodedValue)
Decodes the cookie value according to section 4.1.1 of RFC 6265.
|
static void |
emitJSON(javax.servlet.http.HttpServletResponse inServletResponse,
JsCollection inJSON)
Writes the specified JSON to the servlet response after setting the mime type and character encoding.
|
static void |
emitXMLDoc(javax.servlet.http.HttpServletResponse inServletResponse,
XMLDoc inXMLDoc)
Writes the specified XML file to the servlet response after setting the mime type and character encoding.
|
static String |
encodeCookieValue(String inUnencodedValue)
Encodes the cookie value according to section 4.1.1 of RFC 6265.
|
static boolean |
isCookieEncoded(javax.servlet.http.Cookie inCookie)
Trys to determine if the cookie value has been encoded according to section 4.1.1 of RFC 6265.
|
static boolean |
isCookieEncoded(String inCookieValue)
Trys to determine if the cookie value has been encoded according to section 4.1.1 of RFC 6265.
|
static void |
setupResponseForFileDownload(javax.servlet.http.HttpServletResponse inResponse,
MimeType inMimeType,
File inFile) |
public WebappUtil()
public static void setupResponseForFileDownload(javax.servlet.http.HttpServletResponse inResponse, MimeType inMimeType, File inFile) throws Exception
Exception
public static String encodeCookieValue(String inUnencodedValue)
public static boolean cookieNeedsEncoding(javax.servlet.http.Cookie inCookie)
public static boolean isCookieEncoded(javax.servlet.http.Cookie inCookie)
public static boolean isCookieEncoded(String inCookieValue)
public static String decodeCookieValue(String inEncodedValue)
inEncodedValue
- the encoded cookie value to be decodedpublic static void emitJSON(javax.servlet.http.HttpServletResponse inServletResponse, JsCollection inJSON) throws IOException
inServletResponse
- the servlet response to which the JSON should be writteninJSON
- the JSON to be written to the servlet responseIOException
public static void emitXMLDoc(javax.servlet.http.HttpServletResponse inServletResponse, XMLDoc inXMLDoc) throws Exception
inServletResponse
- the servlet response to which the XML file should be writteninXMLDoc
- the XML file to be written to the servlet responseException
jataylor@hairyfatguy.com