I want to learn how to use Struts 2 and I created a simple application following a tutorial I found.
I’ve created a <MyActionClass>-validation.xml file and I wonder how can I translate the validation messages to multiple languages?
<field name='password'> <field-validator type='requiredstring'> <param name='trim'>true</param> <message>You have to enter a password.</message> <!-- How can I localize this message? --> </field-validator> </field>
Can I get the messages from a localized .properties file or do I have to use some other kind of validation?
OK, I found it out myself. You have to create a .properties file for the class, then you can change the code from:
to: