1:传递参数封装到bean里
@ModelAttribute 会查到表单id与bean属性同名的进行封装
@RequestMapping("/search")
public String getBandwidth(@ModelAttribute SearchBean searchBean, HttpServletRequest request,
HttpServletResponse response) throws Exception {}
public String getBandwidth(@ModelAttribute SearchBean searchBean, HttpServletRequest request,
HttpServletResponse response) throws Exception {}
2:按id传参用于少量参数
@RequestParam
@RequestMapping(value = "/user", method = RequestMethod.POST)
public String userLogin(@RequestParam(value = "user_id", required = false) String userid, @RequestParam(
value = "passwd", required = false) String passwd, HttpServletRequest request, Model model) {}
public String userLogin(@RequestParam(value = "user_id", required = false) String userid, @RequestParam(
value = "passwd", required = false) String passwd, HttpServletRequest request, Model model) {}