Validate on POST data

1. Basic validate  on bean's attribute.

@Notnull

@Max

@Min

@Pattern

...

2. Validate by logic

1) password repeat if same (server validate/client validate)

   

    @InitBinder("form")
    public void initBinder(WebDataBinder binder) {
        binder.addValidators(userCreateFormValidator);
    }

     public class UserCreateFormValidator implements Validator {

      ...

    }


 

posted @ 2015-06-16 17:09  samu  阅读(232)  评论(0编辑  收藏  举报