Tag: message

Thymeleaf:如何在JSR-303批注中使用自定义消息密钥

使用Thymeleaf Person.java public class Person { @NotEmpty(message=”{Valid.Password}”) private String password; } message.properties Valid.Password = Password is Empty!! 的login.html th:errors无法检索’Valid.Password’消息该区域显示为空。 如果消息密钥更改为message.properties的NotEmpty.person.password,那么它正在工作。 如何使用自定义消息密钥?