public class WebappUtil extends java.lang.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 java.lang.String |
decodeCookieValue(java.lang.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 java.lang.String |
encodeCookieValue(java.lang.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(java.lang.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,
java.io.File inFile) |
public WebappUtil()
public static void setupResponseForFileDownload(javax.servlet.http.HttpServletResponse inResponse, MimeType inMimeType, java.io.File inFile) throws java.lang.Exception
java.lang.Exception
public static java.lang.String encodeCookieValue(java.lang.String inUnencodedValue)
public static boolean cookieNeedsEncoding(javax.servlet.http.Cookie inCookie)
public static boolean isCookieEncoded(javax.servlet.http.Cookie inCookie)
public static boolean isCookieEncoded(java.lang.String inCookieValue)
public static java.lang.String decodeCookieValue(java.lang.String inEncodedValue)
inEncodedValue
- the encoded cookie value to be decodedpublic static void emitJSON(javax.servlet.http.HttpServletResponse inServletResponse, JsCollection inJSON) throws java.io.IOException
inServletResponse
- the servlet response to which the JSON should be writteninJSON
- the JSON to be written to the servlet responsejava.io.IOException
public static void emitXMLDoc(javax.servlet.http.HttpServletResponse inServletResponse, XMLDoc inXMLDoc) throws java.lang.Exception
inServletResponse
- the servlet response to which the XML file should be writteninXMLDoc
- the XML file to be written to the servlet responsejava.lang.Exception
[email protected]