spring boot unable to interpolate message for jsr-303 validation
See original GitHub issueif I define the following validation messages,
@Size(min = 3, message = "{validation.account.name}")
private String name;
I expect spring boot would read from messages*.properties
from classpath and find the validation.account.name
key to interpolate the message, but it just shows {validation.account.name}
on the page.
This https://github.com/Zane-XY/springboot-i18n-problem demos the problems.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:29 (10 by maintainers)
Top Results From Across the Web
Springboot error message interpolation not working for custom ...
When i run my springboot application, the interpolation works for JSR-303, but not the custom validator, did i miss something? Tried for long ......
Read more >Spring Validation Message Interpolation | Baeldung
Message interpolation is the process used for creating error messages for Java bean validation constraints. For example, we can see the messages ......
Read more >Java Bean Validation - Interpolating constraint error messages
The message element value represents validation error message. This element usage is optional on client side. If not specified a default message ......
Read more >Chapter 4. Interpolating constraint error messages
Message interpolation is the process of creating error messages for violated Bean Validation constraints. In this chapter you will learn how such messages...
Read more >5. Validation, Data Binding, and Type Conversion - Spring
Outputting messages corresponding to validation errors is the last thing we need ... JSR-303 constructs, from message interpolation to traversal resolution.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
IMHO it should be easy to implement, like this:
It works.
To get it worked I have to move validation keys into the file ValidationMessages.properties while all oder messages reside in messages.properties.
FYI.