Hmm, I don't need a custom validator annotation.


I just created a class that extends AbstractValidator and contributed this to the FieldValidatorSource in my module:

public class MaxBigDecimal extends AbstractValidator<BigDecimal,BigDecimal> {

    private static final String MESSAGE_KEY = "max-bigdecimal";

    public MaxBigDecimal(JavaScriptSupport javaScriptSupport) {
super(BigDecimal.class, BigDecimal.class, MESSAGE_KEY, javaScriptSupport);



This way I can add the validator using the @Validate annotation or validate parameter:

@Validate("required, max-bigdecimal=1")

This all works fine, I can even set the message in my page/component for a field with id "fldRate" by setting the following in the message catalog:

fldRate-max-bigdecimal-message=Some error message

But if I don't "override" this like above it says " [[missing key: max-bigdecimal]]". So I just want to be able to set this default error message in the module contributing this validator. Normally I would have to add a file containing "max-bigdecimal=Some default error message" and contribute this file to the ValidationMessagesSource service. But this service does not exist anymore in 5.4 and just adding the file also doesn't seem to do anything.

Or should I now go with the custom validator annotation way as in your example to get it all working?


On 01/12/16 13:13, JumpStart wrote:
Does this help?




On 1 Dec 2016, at 7:27 PM, Nathan Quirynen <> wrote:


I have a Tapestry module contributing some custom validator implementations. 
How can i set default validation error messages for these in Tapestry 5.4?

In older Tapestry versions I think you had to contribute a message catalog to 
the ValidationMessagesSource service, but this does not exist in Tapestry 5.4.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to