我正在尝试在播放框架中制作通用外部化消息的列表,但无法找到或找出将参数传递给我正在创建的对象中的这些消息的语法。我可以成功使用我创建的没有参数的错误消息。
我尝试了几种不同的方法来声明参数,但没有任何效果示例:
conf/messages: error.number.fixed={0} 必须是 {1} 位
public class Customer {
@Required(message = "error.number.fixed('Phone', '10')" )
public String phone;
}
输出:{"id":["error.number.fixed('Phone', '10'"]}
没有参数,以下工作:
public class Customer {
@Required(message = "error.number.fixed" )
public String phone;
}
输出:{"id":["[] 必须是 {1} 个数字"]}