posted 10 years ago
I want to create a Validator class e.g PersonValidator that implements Validator interface. I want to get the error messages stored in the .properties file (for Internalization).
I am trying to autowire MessageResource to do the same.
this is the xml content
and this is main
and the output is
null
[Field error in object 'person' on field 'name': rejected value [null]; codes [name.required.person.name,name.required.name,name.required.java.lang.String,name.required]; arguments []; default message [null]]
the first null is messageSource getting printed and it is null !
I think i am not able to autowire the messagesource to the .properties file. How should i do it?
Any help would be appreciated.
Thanks in advance.