@Beta public final class HttpServletSupport extends 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 URI |
getFullRequestURI(javax.servlet.http.HttpServletRequest request)
Gets the URL that was requested to generate this request.
|
static 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,
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, String contentType)
response
- the transport to set content type oncontentType
- the content type to setpublic static String getRequestPathWithoutContext(javax.servlet.http.HttpServletRequest request)
HttpServletRequest.getRequestURI()
but without the servlet context
path.request
- request to get the URI frompublic static URI getFullRequestURI(javax.servlet.http.HttpServletRequest request)
request
- current requestCopyright © 1999–2017. All rights reserved.