@Beta public final class HttpServletSupport extends Object
| Modifier | Constructor and Description |
|---|---|
private |
HttpServletSupport()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addNoCacheHeaders(HttpServletResponse response)
Adds Cache-Control and Pragma headers meant to disable caching.
|
static URI |
getFullRequestURI(HttpServletRequest request)
Gets the URL that was requested to generate this request.
|
static String |
getRequestPathWithoutContext(HttpServletRequest request)
Gets the request URI as returned by
HttpServletRequest.getRequestURI() but without the servlet context
path. |
static void |
setContentType(HttpServletResponse response,
String contentType)
Sets the MIME content type of the response.
|
static void |
setUTF8Encoding(HttpServletResponse response)
Sets the character encoding of the transport to UTF-8.
|
public static void addNoCacheHeaders(HttpServletResponse response)
response - transport to add headers topublic static void setUTF8Encoding(HttpServletResponse response)
response - transport to set character encoding typepublic static void setContentType(HttpServletResponse response, String contentType)
response - the transport to set content type oncontentType - the content type to setpublic static String getRequestPathWithoutContext(HttpServletRequest request)
HttpServletRequest.getRequestURI() but without the servlet context
path.request - request to get the URI frompublic static URI getFullRequestURI(HttpServletRequest request)
request - current requestCopyright © 1999–2014. All rights reserved.