I am not sure where and how you have defined the properties
file but when searching for resource bundles struts2 search them in a specific way
- ActionClass.properties.
- BaseClass.properties (all the way to Object.properties)
- Interface.properties (every interface and sub-interface)
- ModelDriven's model (if implements ModelDriven), for the model object repeat from 1
- package.properties (of the directory where class is located and every parent directory all the way to the root directory)
- search up the i18n message key hierarchy itself
- global resource properties (webwork.custom.i18n.resources) defined in webwork.properties
refer document for details /internationalization.
Additionally The Struts 2 key attribute can be used in the textfield tag to instruct the framework what value to use for the textfield's name and label attributes.Instead of providing those attributes and their values directly, you can just use the key attribute.
So either use name="username" key="label.username".
Just go through the official documents for details how this work and how framework search for the property files
message-resource-files