Adding multiple validators using initBinder

后端 未结 8 1511
傲寒
傲寒 2020-12-04 18:04

I\'m adding a user validator using the initBinder method:

@InitBinder
    protected void initBinder(WebDataBinder binder) {
        binder.setVa         


        
8条回答
  •  隐瞒了意图╮
    2020-12-04 18:58

    Declare request as

    (... , Model model,HttpServletRequest request)

    and change

    model.addAttribute(customerPayment);
    

    to

    request.setAttribute("customerPayment",customerPayment);
    

提交回复
热议问题