Copy passed parameters into the service call #4278
Showing
1 changed file
with
9 additions
and
0 deletions
... | @@ -143,6 +143,15 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -143,6 +143,15 @@ public class DirectControlServlet extends HttpServlet { |
143 | context.put(key, items.get(key)); | 143 | context.put(key, items.get(key)); |
144 | } | 144 | } |
145 | } else if ("text/csv".equals(contentType)) { | 145 | } else if ("text/csv".equals(contentType)) { |
146 | // Directly copy request parameters into context. | ||
147 | for (Enumeration<String> params = request.getParameterNames(); params.hasMoreElements();) { | ||
148 | String param = params.nextElement(); | ||
149 | Object[] values = request.getParameterValues(param); | ||
150 | if (!"sessionId".equals(param) && !"_method".equals(param)) { | ||
151 | context.put(param, values.length == 1 ? values[0] : values); | ||
152 | } | ||
153 | } | ||
154 | |||
146 | Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(request.getReader()); | 155 | Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(request.getReader()); |
147 | List data = new ArrayList(); | 156 | List data = new ArrayList(); |
148 | for (CSVRecord record : records) { | 157 | for (CSVRecord record : records) { | ... | ... |
-
Please register or sign in to post a comment