Renders a list of rows as text/csv, converting each row's values to text with the current Formatter. Built from a plain list of rows via ViewsBuilder.csvView(...) in server-side JS, so each row can be a Java list or a script value (Nashorn ScriptObjectMirror or a Graal Value/PolyglotMapAndFunction), which is converted to a list before formatting. Supports partial output through a byte-offset range.
Group: Views
Implements: View, Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| contentType | String | The content type sent with the response, always "text/csv". |
| description | String | Short, user-facing label for this view, always "CSV view". |
Methods
getDescription()
Returns: String
Short, user-facing label for this view, always "CSV view".
render(CommonResource page, OutputStream out, Range range, Map<String,String> params, String contentType)
Returns: void
Renders the rows as CSV text and writes it to the response, restricted to the requested byte range if any.
| Parameter | Description |
|---|---|
page | the resource the view is being rendered for, not used by this view |
out | the stream the CSV text is written to |
range | if given, only the bytes within this range are written |
params | request parameters, not used by this view |
contentType | not used by this view; getContentType() supplies the response content type |
getContentType()
Returns: String
The content type sent with the response, always "text/csv".
toRange(String text, Range range)
Returns: String
Extracts the substring of the rendered CSV text falling within the given byte range, or the whole text if no range is given.
| Parameter | Description |
|---|---|
text | the full rendered CSV text |
range | the byte range to extract, or null to return the whole text |