I'm working on internationalizing my messages and centralizing them. I have the following methods:
private static void addMessage(Severity severity, String mensagem, Object...args){
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage facesMessage = new FacesMessage(severity, String.format(get(mensagem, args)), "");
context.addMessage(null, facesMessage);
}
public static void addInfoMessage(String chave, Object...args){
addMessage(FacesMessage.SEVERITY_INFO, chave, args);
}
public static void addInfoMessage(String chave){
addMessage(FacesMessage.SEVERITY_INFO, chave, new Object[]{null});
}
To try to reuse code I'm trying to pass as null
my array of objects. However in the addMessage
method an object for my class that is calling addInfoMessage
is arriving. Does anyone know why and how do I resolve it?