Annotation Interface Attachment
Should be used on
EntryPath-annotated methods on Controller-annotated classes.
This turns the method return body content into an "attachment" via Content-Disposition headers (file downloads).
Most effective on File return types.
- If return type is a
File, the content type is changed to the file's predicted MIME-type, the content is the file's content, verbatim, and the output filename is the file's name. If the file is null, this sends a 404. - If return type is a
String,StringBuilder, orStringBuffer, plain text is sent back. Content type istext/plain. - If return type is byte[], binary data is sent back. Content type is
application/octet-stream, and the output filename is the page name. - If return type is any other object type,
- ...and a
XMLDrivercomponent is found, and the specified content type isapplication/xmlor an XML subtype, the object is converted to XML. - ...and a
JSONDrivercomponent is found, content type isapplication/jsonand the object is converted.
- ...and a
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueForced MIME-Type.- Returns:
- MIME-Type name. Default is empty string.
- Default:
- ""
-