怪我咯2017-04-18 10:47:41
Did you include two pIDs in the parameters? For example:
http://.../showCorrelation?pID=34cb...&pID=3574...
req.getParameter("pID") will only get one of them (if there are multiple parameters with "pID" as the key parameter, please check the Javadoc of Servlet API or the source code of Servlet Container for the specific number). It will get all of them. Parameters with "pID" as key must use req.getParameterValues();
Check how Spring MVC explains @RequestParam, or see how the source code implements it. Will it take out all the parameters with "pID" as the key? If there are more than one, use commas to connect them?
高洛峰2017-04-18 10:47:41
There is a problem with the return view, the reason is that we return json
不返回视图,所以应该在HandlerExceptionResolver
中将return null
改为return new ModelAndView()
;