0

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

Sam
  • 313
  • 4
  • 21
  • If memory serves, a `message` tag displays messages matching the [client identifier](http://illegalargumentexception.blogspot.co.uk/2009/10/jsf-working-with-component-identifiers.html) specified in its "for" attribute. So, for the _component identifier_ "name" the _client identifier_ usually takes the form `container0:container1:name`. – McDowell May 29 '14 at 12:58
  • http://stackoverflow.com/questions/315804/how-to-display-my-applications-errors-in-jsf McDowells old answer – Aksel Willgert May 29 '14 at 12:59
  • oh sorry you are right there was already the answer. thankyou very much. – Sam May 29 '14 at 13:14

0 Answers0