5 Rendering To The Response - Reference Documentation
Authors: Grails Plugin Collective
Version: 1.0.0
5 Rendering To The Response
There are four methods added to all controllers for rendering:- renderPdf(Map args)
- renderGif(Map args)
- renderPng(Map args)
- renderJpeg(Map args)
«format»RenderingService.render(args + [controller: this], response)
render()
method take, plus some extras.Extra Render Arguments
All rendering methods take aMap
argument that specifies which template to render and the model to use (in most cases).The following map arguments are common to all rendering methods:
filename
(option) - sets theContent-Disposition
header withattachment; filename="$filename";
(asking the browser to download the file with the given filename)contentType
(optional) - theContent-Type
header value (see Content Type Defaults below)
Default Content Types
The default content types are…- application/pdf
- image/gif
- image/png
- image/jpeg