I have some business logic code that renders some facesMessages on the facelet based on its output, so i made a method in the facelet managed bean like this method:
public void renderFacesMessages(String summary, String detail) {
FacesMessage message = new FacesMessage(summary, detail);
FacesContext.getCurrentInstance().addMessage(null, message);
}
and the business logic class will pass arguments to this method according to the message that's needed, the question is what is the right approach for business logic to call this method on the managed bean?