Annotation Interface Content
Should be used on
EntryPath-annotated methods on Controller-annotated classes.
On parameters, the request body content is passed in as the following:
-
If the content type is any of the
application/xmlequivalents and aXMLDrivercomponent is found, the driver is used to convert to the target type. -
If the content type is
application/jsonand aJSONDriveris found, the driver is used to convert to the target type. - Else, if the content is anything else, the following types are valid as a target type:
- All primitives (if input is parseable text).
- All boxed primitives (if input is parseable text).
- byte[],
ByteArrayInputStream,ServletInputStream,InputStream(for binary). String,StringReader,BufferedReader,InputStreamReader,Reader(for characters).
- Otherwise, an error is thrown.
RequestMethod.POST, RequestMethod.PUT, or RequestMethod.PATCH.
If on a method, this converts the returned object after running the method into data that is put into the response body.
- If return type is a
SmallResponse, its content is the object to convert (other headers and statuses are set on the response), and conversion continues below for the content... - If return type is a
SmallModelView, the view is resolved and written to the response. - If return type is a
File,- ...the content type is changed to the file's predicted MIME-type and the content is the file's content, verbatim. Unknown type is
application/octet-stream. - ...and is null, this sends a 404.
- ...the content type is changed to the file's predicted MIME-type and the content is the file's content, verbatim. Unknown type is
- If return type is a
Reader,CharSequence,String,StringBuilder, orStringBuffer, plain text is sent back. Content type istext/plainif unspecified. - If return type is byte[] or
ByteBufferbinary data is sent back. Content type isapplication/octet-streamif unspecified. - 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
- Author:
- Matthew Tropiano
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String value- Returns:
- the forced MIME-Type.
- Default:
- ""
-