這樣方法是不是只能針對于post請求,參數為實體類的情況
如標題,這種可以返回
但如果是get請求,傳字符串參數,
返回值:
{
? ? "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 請求怎么會有表單驗證呢?只有 Post 請求才會提交數據,有驗證的需求吧。