Hello.
I must get data from POST in the same order as it sent but can not found any way to do this.
The following code read nothing with reader and read data in wrong order with getParameterNames().
What I'm doing wrong?
Code:@RequestMapping(value = "/test") public ResponseEntity<String> test(HttpServletRequest request) { System.out.println("Reader:"); BufferedReader reader; try { reader = request.getReader(); String line; do { line = reader.readLine(); //null here on first iteration System.out.println(line); } while (line != null); } catch (IOException e) { e.printStackTrace(); } System.out.println("Params:"); Enumeration<String> requestParamNames = (Enumeration<String>)request.getParameterNames(); while (requestParamNames.hasMoreElements()) { String pName = (String) requestParamNames.nextElement(); String pValue = request.getParameter(pName); System.out.println(pName + " = " + pValue); }


Reply With Quote