Never used ValidationMessages but I can tell you how I add additional resources:

public static void 
contributeComponentMessagesSource(OrderedConfiguration<Resource> 
additionalBundles, TypeCoercer typeCoercer) {

        String path = "validation.properties";

        final Resource resource = typeCoercer.coerce(path, Resource.class);

        if (resource.exists()) {

            additionalBundles.add(key, resource);

        } else {

            // log or throw exceptions if you like
        }
}

... 

@Inject
private Messages messages;

...

messages.format("required", fieldName);

et voilá :-)


Am 06.01.2011 um 10:59 schrieb Stephan Windmüller:

> Hi!
> 
> Our migration to Tapestry 5.2 was very smooth with only a few glitches.
> Now I am trying to resolve the last deprecation issues and stumbled upon
> ValidationMessagesSource. I am using it like this:
> 
> validationMessages.getValidationMessages(locale).format("required",
> fieldName));
> 
> I fetched this usage from FieldTranslatorSourceImpl but the one shipped
> with Tapestry 5.2 still uses the deprecated ValidationMessagesSource.
> 
> According to the JavaDoc I should use ComponentMessagesSource but I
> cannot figure out how to get the same output.
> 
> Regards
> Stephan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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

Reply via email to