Ask Your Question
4

Why is BindingResult.rejectValue unable to locate the value from ValidationMessages.properties?

asked 2021-10-18 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-10 01:00:00 +0000

bukephalos gravatar image

There are several possible reasons why BindingResult.rejectValue may be unable to locate the value from ValidationMessages.properties:

  1. Incorrect property key name: Make sure that the property key name in ValidationMessages.properties matches the field name in your model object.

  2. Missing ValidationMessages.properties file: Ensure that the ValidationMessages.properties file is present in the correct location and contains the correct property key names.

  3. 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.

  4. Property file encoding issue: Ensure that the property file is encoded correctly to avoid character encoding issues.

  5. 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.

edit flag offensive delete link more

Your Answer

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

Add Answer


Question Tools

Stats

Asked: 2021-10-18 11:00:00 +0000

Seen: 22 times

Last updated: Apr 10 '21