Struts 2 how to get i18n messages from within a custom validator
问题 How is it possible to get the message from key in the custom validator ?! As mentioned in Struts 2 - reusing Custom Expression Validator you can get default message as : public void validate(Object o) throws ValidationException { //Do some logic addActionError(getDefaultMessage()); } 回答1: Your custom validator should extend ValidatorSupport class, which has a convenient method getMessage(Object object) to get i18n messages set with key parameter. So inside validate method instead of calling