@RequestMapping(method = RequestMethod.GET, params = "businessType=enroll") public ModelAndView nc_certServiceEnroll(@RequestParam(value="itrus_code",required=false) String itrus_code, @RequestParam(value="itrus_code",required=false) String nc_group)
HTTP Status 400
如果用@RequestMapping注解的参数是int基本类型,但是required=false,这时如果不传参数值会报错,因为不传值,会赋值为null给int
可以通过required=false或者true来要求@RequestParam配置的前端参数是否一定要传
(@RequestParam(value="itrus_code",required=false)
可以对传入参数指定参数名
原文地址:http://yjm199.blog.51cto.com/4408395/1917629