@SuppressWarnings("unchecked")
public void render(Map model, HttpServletRequest request, HttpServletResponse response)
throws IOException
{
TupleQueryResultWriterFactory qrWriterFactory = (TupleQueryResultWriterFactory)model.get(FACTORY_KEY);
TupleQueryResultFormat qrFormat = qrWriterFactory.getTupleQueryResultFormat();
response.setStatus(SC_OK);
setContentType(response, qrFormat);
setContentDisposition(model, response, qrFormat);
OutputStream out = response.getOutputStream();
try {
TupleQueryResultWriter qrWriter = qrWriterFactory.getWriter(out);
TupleQueryResult tupleQueryResult = (TupleQueryResult)model.get(QUERY_RESULT_KEY);
QueryResultUtil.report(tupleQueryResult, qrWriter);
}
catch (QueryEvaluationException e) {
logger.error("Query evaluation error", e);