springmvc判断请求是get还是post
答案:2 悬赏:50 手机版
解决时间 2021-02-28 07:19
- 提问者网友:献世佛
- 2021-02-27 19:32
springmvc判断请求是get还是post
最佳答案
- 五星知识达人网友:西风乍起
- 2021-02-27 19:52
@RequestMapping(value="/update/{id}",method=RequestMethod.GET)
public String update(@PathVariable int id,Model model) {
\x05...
}
\x05
@RequestMapping(value="/update/{id}",method=RequestMethod.POST)
public String update(@PathVariable int id,@Valid UserDto userDto,BindingResult br,Model model) {
\x05...
}
method=RequestMethod.GET
method=RequestMethod.POST
public String update(@PathVariable int id,Model model) {
\x05...
}
\x05
@RequestMapping(value="/update/{id}",method=RequestMethod.POST)
public String update(@PathVariable int id,@Valid UserDto userDto,BindingResult br,Model model) {
\x05...
}
method=RequestMethod.GET
method=RequestMethod.POST
全部回答
- 1楼网友:走死在岁月里
- 2021-02-27 21:21
@requestmapping(value="/update/{id}",method=requestmethod.get)
public string update(@pathvariable int id,model model) {
...
}
@requestmapping(value="/update/{id}",method=requestmethod.post)
public string update(@pathvariable int id,@valid userdto userdto,bindingresult br,model model) {
...
}method=requestmethod.get
method=requestmethod.post
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯