這樣方法是不是只能針對(duì)于post請(qǐng)求,參數(shù)為實(shí)體類的情況
如標(biāo)題,這種可以返回
但如果是get請(qǐng)求,傳字符串參數(shù),
返回值:
{
? ? "code": -1,
? ? "msg": "An Errors/BindingResult argument is expected to be declared immediately after the model attribute, the @RequestBody or the @RequestPart arguments to which they apply: public com.example.demo.model.CommonMsg com.example.demo.controller.UservisitorController.SelectAll(org.springframework.validation.BindingResult)",
? ? "data": null
}
2019-02-22
get 請(qǐng)求怎么會(huì)有表單驗(yàn)證呢?只有 Post 請(qǐng)求才會(huì)提交數(shù)據(jù),有驗(yàn)證的需求吧。