Methods added to javax.servlet.http.HttpServletResponse for response format handling.
| Modifiers | Name | Description |
|---|---|---|
protected java.util.regex.Pattern |
disableForUserAgents |
|
protected boolean |
useAcceptHeader |
| Type | Name and description |
|---|---|
MimeTypesApiSupport |
apiSupport |
GrailsApplication |
grailsApplication |
MimeType[] |
mimeTypes |
| Constructor and description |
|---|
ResponseMimeTypesApi
()Initialize with default settings |
ResponseMimeTypesApi
(GrailsApplication application, MimeType[] types)Initialize with settings provided by GrailsApplication and the given MimeType[] |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
getFormat(javax.servlet.http.HttpServletResponse response)Obtains the format to use for the response using either the file extension or the ACCEPT header |
|
MimeType |
getMimeType(javax.servlet.http.HttpServletResponse response)Obtains the MimeType for the response using either the file extension or the ACCEPT header |
|
MimeType |
getMimeTypeForRequest(GrailsWebRequest webRequest) |
|
MimeType[] |
getMimeTypes() |
|
MimeType[] |
getMimeTypes(javax.servlet.http.HttpServletResponse response)Gets the configured mime types for the response |
|
MimeType[] |
getMimeTypesFormatAware(javax.servlet.http.HttpServletResponse response)Gets the configured mime types for the response |
|
protected void |
loadConfig() |
|
java.lang.Object |
withFormat(javax.servlet.http.HttpServletResponse response, groovy.lang.Closure callable)Allows for the response.withFormat { } syntax |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Initialize with default settings
Initialize with settings provided by GrailsApplication and the given MimeType[]
application - The GrailsApplicationmimeTypes - The mime typesObtains 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 closureGroovy Documentation