Java Reference
In-Depth Information
Support message interpolation using expression language
With this version of the specification, it is possible to use expression language when
defining the error message. It helps in better formatting of the message and the use
of conditions in the description of the message. The following code shows a possible
use of expression language in the definition of an error message:
public class Department implements Serializable
{
@Size(max = 30, message="A department must
have at most {max}level${max > 1 ? 's' : ''}")
private Integer nbrlevel;
//...
}
Search WWH ::




Custom Search