g*****g 发帖数: 34805 | 1 I know how to specify a validator to validate the data from input, but
within
SimpleFormController, after you finish inital check, sometimes you need to
perform a database check.
e.g. Make sure the new password doesn't equal to the old one.
I check the document, it seems I have to call the showForm method if
I find errors. The error is of type BindException, Now the only question is
how to I construct a BindException so that it supports I18N? | g*****g 发帖数: 34805 | 2 Is it calling getErrorsForNewForm?
BindException errors = getErrorsForNewForm(request);
errors.reject(...);
return showForm(request, response, errors);
Had to dig into source code a bit and find out, :-)
is
【在 g*****g 的大作中提到】 : I know how to specify a validator to validate the data from input, but : within : SimpleFormController, after you finish inital check, sometimes you need to : perform a database check. : e.g. Make sure the new password doesn't equal to the old one. : I check the document, it seems I have to call the showForm method if : I find errors. The error is of type BindException, Now the only question is : how to I construct a BindException so that it supports I18N?
|
|