017e74f9 by Ean Schuessler

Copy passed parameters into the service call #4278

1 parent cb76eeec
......@@ -143,6 +143,15 @@ public class DirectControlServlet extends HttpServlet {
context.put(key, items.get(key));
}
} else if ("text/csv".equals(contentType)) {
// Directly copy request parameters into context.
for (Enumeration<String> params = request.getParameterNames(); params.hasMoreElements();) {
String param = params.nextElement();
Object[] values = request.getParameterValues(param);
if (!"sessionId".equals(param) && !"_method".equals(param)) {
context.put(param, values.length == 1 ? values[0] : values);
}
}
Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(request.getReader());
List data = new ArrayList();
for (CSVRecord record : records) {
......