原因:由于传得参数类型和接收的参数类型不一致导致无法再controller层接收数据。
解决办法:将参数类型修改一致。
如下:
jsp页面:
$.post("${pageContext.request.contextPath}/rep/findRep", { rep1 : any_1 },
function(data) {}
});
controller层:
@RequestMapping("findRep")
public Map findRep(HttpServletRequest request,Integer rep1,Integer page) {}
由于接收的rep1是integer类型,
所以在jsp中传数据 为“qwe”不能被转成int类型所以会包400错误。
解决:
严格限制rep1参数为数字。