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?
Did you include two pIDs in the parameters? For example:
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?
There is a problem with the return view, the reason is that we return
json
不返回视图,所以应该在HandlerExceptionResolver
中将return null
改为return new ModelAndView()
;