This one is related to my previous post. Is it possible in GWT validation framework to specify location of ValidationMessages.properties files and their names? I already have messages translations in my application and I'd prefer them to be in one location.
            Asked
            
        
        
            Active
            
        
            Viewed 897 times
        
    3
            
            
        1 Answers
4
            You could create a custom UserValidationMessagesResolver:
public class CustomValidationMessagesResolver extends AbstractValidationMessageResolver implements UserValidationMessagesResolver {
    protected CustomValidationMessagesResolver() {
        super((ConstantsWithLookup) GWT.create(ValidationConstants.class));
    }
}
In the above code, ValidationConstants is the class resulting from running I18NSync on my properties file.
Then in *.gwt.xml:
<replace-with class="yourpackage.client.validation.CustomValidationMessagesResolver">
    <when-type-is class="com.google.gwt.validation.client.UserValidationMessagesResolver" />
</replace-with>
You can find a complete example here.
        David Levesque
        
- 22,181
 - 8
 - 67
 - 82