@CompileStatic class HttpServletResponseExtension extends Object
Extends the HttpServletResponse object with new methods for handling MimeType instances
Type | Name and description |
---|---|
static MimeTypesApiSupport |
apiSupport |
static Pattern |
disableForUserAgents |
static boolean |
useAcceptHeader |
static boolean |
useAcceptHeaderXhr |
Constructor and description |
---|
HttpServletResponseExtension() |
Type Params | Return Type | Name and description |
---|---|---|
|
static String |
getFormat(HttpServletResponse response) Obtains the format to use for the response using either the file extension or the ACCEPT header |
|
static MimeType |
getMimeType(HttpServletResponse response) Obtains the MimeType for the response using either the file extension or the ACCEPT header |
|
static MimeType[] |
getMimeTypes() |
|
static MimeType[] |
getMimeTypes(HttpServletResponse response) Gets the configured mime types for the response |
|
static MimeType[] |
getMimeTypesFormatAware(HttpServletResponse response) Gets the configured mime types for the response |
|
static void |
loadMimeTypeConfig(Config config) |
|
static Object |
withFormat(HttpServletResponse response, Closure callable) Allows for the response.withFormat { } syntax |
Obtains the format to use for the response using either the file extension or the ACCEPT header
response
- The responseObtains the MimeType for the response using either the file extension or the ACCEPT header
response
- The responseGets the configured mime types for the response
response
- The responseGets the configured mime types for the response
response
- The responseAllows for the response.withFormat { } syntax
response
- The responsecallable
- A closure