Hi,

I have a custom validator: 

public class MyPasswordValidator extends AbstractValidator<Void, String>

and I want to use my default messages for user output. I already tried:

@Inject
private Messages messages;

But its always null and doesn't work in my validator. So I will use the
constructor:

public MyPasswordValidator(Messages messages) {
    this.messages = messages;
}

And now I am stuck here:

AppModule.java

public static void
contributeFieldValidatorSource(MappedConfiguration<String,
Validator&lt;?,?>> configuration) {
    configuration.add("myPassword", new MyPasswordValidator(???));
}

Where do I get the message resource? I couldn't find any example on this.

Thx
sub




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-use-messages-without-Inject-tp5658897p5658897.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to