Apache Struts 2 Documentation > Home > FAQs > How do I change the invalid input error message for a particular field
Added by Jay Bose, last edited by Ted Husted on Jul 22, 2006  (view change) show comment

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.