Apache Struts 2 Documentation > Home > FAQs > How do I change the invalid input error message for a particular field |

Apache Struts 2 Documentation
How do I change the invalid input error message for a particular field
Edit Page Browse Space Add Page Add News
Added by digi9ten, last edited by Ted Husted on Jul 22, 2006 (view change) show comment hide comment
Comment:
Update formatting
View page history

The "stock" validators provide default error messages. To override the default message,

- create or edit a global resource bundle, and
- add an entry corresponding to the field

The "message prefix" is `invalid.fieldvalue`. To create a message entry, append the field name to the prefix. For example, a field named `user.dob` would use the entry `invalid.fieldvalue.user.dob`.

    invalid.fieldvalue.user.dob=Please enter Date of Birth in the correct format.