message format binding

The standard way for Tapestry5 you want to bind a formatted massage with a parameter, you must declare a method in your component/page class, that returns the formatted message for the parameter like this:

This binding lets you evaluate Java code directly from template via OGNL like above described.

standard tapestry sample

the standard tapestry class looks like this:

...

public List getFormattedAddressString()
{
    return messages.format("message-label", name, city, street);
}

...

the standard tapestry template looks like this:

...

${formattedAddressString}

...

the standard tapestry properties file looks like this:

...

message-label = Hello %s from %s, you live in the street named %s

...

sample with message format binding

the advantage of the MessageFormatBinding is allows you to specify values to use in a message inline like this:

...

${messageformat:message-label=name, city, street}

...