@RequestParam 注解的作用是把请求中的指定名称的参数传递给控制器中的形参赋值。
1.不加@RequestParam前端的参数名需要和后端控制器的变量名保持一致才能生效。
2.不加@RequestParam参数为非必传,加@RequestParam写法参数为必传。
3.@RequestParam可以通过@RequestParam(required = false)设置为非必传。因为required值默认是true,所以默认必传。
4.@RequestParam可以通过@RequestParam(“userId”)或者@RequestParam(value = “userId”)指定参数名。
5.@RequestParam可以通过@RequestParam(defaultValue = “0”)指定参数默认值