public final class ReqRspUtil extends Object
Constructor and Description |
---|
ReqRspUtil() |
Modifier and Type | Method and Description |
---|---|
static Pair<String,Object>[] |
add(Pair<String,Object>[] items,
String name,
Object value) |
static String |
decode(String str,
String charset,
boolean force) |
static String |
encode(String str,
Charset charset) |
static String |
encode(String str,
String charset) |
static String |
encodeRedirectURLEL(javax.servlet.http.HttpServletResponse rsp,
String url)
if encodings fails the given url is returned
|
static String |
get(Pair<String,Object>[] items,
String name) |
static LinkedList<MimeType> |
getAccept(PageContext pc) |
static Charset |
getCharacterEncoding(PageContext pc,
javax.servlet.ServletRequest req) |
static Charset |
getCharacterEncoding(PageContext pc,
javax.servlet.ServletResponse rsp) |
static MimeType |
getContentType(PageContext pc) |
static String |
getContentTypeAsString(PageContext pc,
String defaultValue) |
static javax.servlet.http.Cookie[] |
getCookies(javax.servlet.http.HttpServletRequest req,
Charset charset) |
static String |
getDomain(javax.servlet.http.HttpServletRequest req) |
static String |
getHeader(javax.servlet.http.HttpServletRequest request,
String name,
String defaultValue) |
static String |
getHeaderIgnoreCase(PageContext pc,
String name,
String defaultValue) |
static List<String> |
getHeadersIgnoreCase(PageContext pc,
String name) |
static String |
getQueryString(javax.servlet.http.HttpServletRequest req) |
static Object |
getRequestBody(PageContext pc,
boolean deserialized,
Object defaultValue)
returns the body of the request
|
static String |
getRequestURL(javax.servlet.http.HttpServletRequest req,
boolean includeQueryString)
returns the full request URL
|
static String |
getRootPath(javax.servlet.ServletContext sc) |
static String |
getScriptName(PageContext pc,
javax.servlet.http.HttpServletRequest req) |
static boolean |
identical(javax.servlet.http.HttpServletRequest left,
javax.servlet.http.HttpServletRequest right) |
static boolean |
isThis(javax.servlet.http.HttpServletRequest req,
String url) |
static boolean |
isThis(javax.servlet.http.HttpServletRequest req,
URL url) |
static boolean |
needDecoding(String str) |
static boolean |
needEncoding(String str,
boolean allowPlus) |
static void |
removeCookie(javax.servlet.http.HttpServletResponse rsp,
String name) |
static String |
self(javax.servlet.http.HttpServletRequest req)
return path to itself
|
static Pair<String,Object>[] |
set(Pair<String,Object>[] items,
String name,
Object value) |
static void |
setCharacterEncoding(javax.servlet.http.HttpServletResponse rsp,
String charset) |
static void |
setContentLength(javax.servlet.http.HttpServletResponse rsp,
int length) |
static void |
setContentLength(javax.servlet.http.HttpServletResponse rsp,
long length) |
static javax.servlet.http.Cookie |
toCookie(String name,
String value,
javax.servlet.http.Cookie defaultValue) |
static Object |
toObject(PageContext pc,
byte[] data,
int format,
Charset charset,
Object defaultValue) |
public ReqRspUtil()
public static String self(javax.servlet.http.HttpServletRequest req)
req
- public static void setContentLength(javax.servlet.http.HttpServletResponse rsp, int length)
public static void setContentLength(javax.servlet.http.HttpServletResponse rsp, long length)
public static javax.servlet.http.Cookie[] getCookies(javax.servlet.http.HttpServletRequest req, Charset charset)
public static javax.servlet.http.Cookie toCookie(String name, String value, javax.servlet.http.Cookie defaultValue)
public static void setCharacterEncoding(javax.servlet.http.HttpServletResponse rsp, String charset)
public static String getQueryString(javax.servlet.http.HttpServletRequest req)
public static String getHeader(javax.servlet.http.HttpServletRequest request, String name, String defaultValue)
public static String getHeaderIgnoreCase(PageContext pc, String name, String defaultValue)
public static List<String> getHeadersIgnoreCase(PageContext pc, String name)
public static String getScriptName(PageContext pc, javax.servlet.http.HttpServletRequest req)
public static boolean needEncoding(String str, boolean allowPlus)
public static boolean needDecoding(String str)
public static LinkedList<MimeType> getAccept(PageContext pc)
public static MimeType getContentType(PageContext pc)
public static String getContentTypeAsString(PageContext pc, String defaultValue)
public static Object getRequestBody(PageContext pc, boolean deserialized, Object defaultValue)
pc
- deserialized
- if true lucee tries to deserialize the body based on the content-type, for example when the content type is "application/json"defaultValue
- value returned if there is no bodypublic static String getRequestURL(javax.servlet.http.HttpServletRequest req, boolean includeQueryString)
req
- - the HttpServletRequestincludeQueryString
- - if true, the QueryString will be appended if one existspublic static String getRootPath(javax.servlet.ServletContext sc)
public static Object toObject(PageContext pc, byte[] data, int format, Charset charset, Object defaultValue)
public static boolean identical(javax.servlet.http.HttpServletRequest left, javax.servlet.http.HttpServletRequest right)
public static Charset getCharacterEncoding(PageContext pc, javax.servlet.ServletRequest req)
public static Charset getCharacterEncoding(PageContext pc, javax.servlet.ServletResponse rsp)
public static void removeCookie(javax.servlet.http.HttpServletResponse rsp, String name)
public static String encodeRedirectURLEL(javax.servlet.http.HttpServletResponse rsp, String url)
rsp
- url
- Copyright © 2015 Lucee