我有一个像下面这样的getter方法:
@NotNull
@NotEmpty
@Pattern(regexp="[0-9]{6}")
@XmlAttribute(name="CustomerID")
public String getCustomerId() {
return customerId;
}
message.properties有
NotEmpty.customerForm.customerId = CustomerID required
NotNull.customerForm.customerId = Customer ID required
Pattern.customerForm.customerId = Ship To Account must be a valid number
但即使我将CustomerId保持为空白或为空,它始终显示消息“发送至帐户”必须是有效数字,它始终显示所需的客户ID消息。