|
|
Filtering exceptions from Spring BindErrors
pany.MyWrapperObject for property myWrapperObject; nested exception is java.lang.IllegalArgumentException: A MyWrapperObject must have a length of 8 characters.
In this case all I want to display as an error message for this field is quot;A MyWrapperObject must have a length of 8 characters.quot;
How can I manipulate Spring BindErrors for this spesific FieldError to filter out the excess information?
Edit: It seems I asked this question before on this forum.Edit2: I have tried to implement a BindingErrorProcessor, but it is not used by Spring in my case.
@InitBinder public void initBinder(fromServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.setBindingErrorProcessor(new BindingErrorProcessorImpl()); } |
|