3
I forced an error on my system that contains the following message:
javax.persistence.Persistenceexception: org.hibernate.Exception.Constraintviolationexception: could not execute statement
It is a violation of Constraint. How can I customize to display an example in-depth message: Warning: This name already exists in the database.
I even created a class for Messages and has this method:
public static void erro(String mensagem) {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, mensagem, "");
FacesContext.getCurrentInstance().addMessage("messagePanel", msg);
}
Thanks in advance.
And how I put the message I want?
– Roknauta