0

I would like to customize my error message in the following way:

Assume following declaration of a class Person:

@Size(min=10, max=250, message="{size.name}")
private String name;

Within the declared error message in ValidationMessages.properties I would like to output the field value as well, i.e. I would like to do something like this:

size.name = The name '${validatedvalue}' is invalid, its size must be between {min} and {max}

Assume the content of the field 'name' is “xyz”. Then the error message should look like this:

The name 'xyz' is invalid, its size must be between 10 and 250

The substitution for min and max works, but filed value i am getting as '' ,how can I do this for the field value?

sateesh466
  • 37
  • 2
  • 10

0 Answers0