There are several possible reasons why BindingResult.rejectValue may be unable to locate the value from ValidationMessages.properties:
Incorrect property key name: Make sure that the property key name in ValidationMessages.properties matches the field name in your model object.
Missing ValidationMessages.properties file: Ensure that the ValidationMessages.properties file is present in the correct location and contains the correct property key names.
The property file is not loaded: Check if the ValidationMessages.properties file is loaded correctly by the application. In some cases, you may need to explicitly configure and load the property file.
Property file encoding issue: Ensure that the property file is encoded correctly to avoid character encoding issues.
Mismatch between locale and property file: Check that the locale of the ValidationMessages.properties file matches the locale of the user's session. If the two are different, the appropriate message may not be displayed.
By addressing any of these possible issues, BindingResult.rejectValue should be able to locate the value from ValidationMessages.properties.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-10-18 11:00:00 +0000
Seen: 15 times
Last updated: Apr 10 '21
How can I prevent the modification of another object's property through reference?
What is the method to make a TextButton inactive when the text field has no text?
Can you explain the meaning of "Linearizability"?
Is there an equivalent of the CSS property "float:right" in LinearLayout on android?
What is the method for including MSBuild parameters in launchSettings.json?
Is there a potential for a conflict between the name of a class and the name of a property?