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