I have to show some error after had catch an exception in the bean:
This is the message:
<h:message id="mname" for="name" />
This is part of the method in the bean:
try{
ejb_partymanager.createNewParty(party,ejb_user.getLoggedCitizen());
return "partycorrectlycreated?faces-redirect=true";
}catch(SuperEntityManagerException ex){
FacesContext.getCurrentInstance().addMessage("mname",
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", ex.getMessage()));
System.out.println("Something wrong");
}
return "#";
Now the problem consists in the fact that i see in the console the output "Something wrong", but i can't see any message error where it should appear.
What did i mistake?!?!
Thankyou in advance, Samuele