- 通过@PathVariabl注解获取路径中传递参数
- 用@ModelAttribute注解获取POST请求的FORM表单数据
- 直接用HttpServletRequest获取
- 用注解@RequestParam绑定请求参数a到变量a
当请求参数a不存在时会有异常发生,可以通过设置属性required=false解决,
例如:@RequestParam(value="a", required=false)
@RequestParam(value="a", required=false)