@RequestParam与@异同

1、@RequestParam,@RequestParam("xx") 表示在前端传递过来的参数中必须有个参数名称为“xx”(可以使用required=false避免必须)

2、@ModelAttribute,@ModelAttribute("xx") 表示将前端传递过来的参数值(value),按照标签(name)名称注入到对应的对象中,“xx”只是表示放到ModelMap中的key值

posted @ 2020-03-29 23:41  笑等茶凉  阅读(142)  评论(0)    收藏  举报