myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Verhoye" <>
Subject RE: incorrect display of error message
Date Wed, 13 Jul 2005 09:30:33 GMT
Hi Wolfgang,

I have had the same problem regarding error messages. In my case it
displayed every error twice in the messages list as well, using the
h:messages tag. I'm now using this combo and that seems to work:

<h:messages globalOnly="true" styleClass="errors"/>          
<h:message for="loginInput" styleClass="errors"/>

Whenever I use the globalOnly attribute (set to true) for the messages tag,
it displays my messages only once. If I don't do that, it will display them
twice (I don't know why though).

As for the message tag: the fact that it displays the entry twice on one
line is similar to having set the showDetail attribute of the h:message tag
to true, which is the default. Try setting it to false, or specify an entry
in your resource bundle in order to see if the system is using your primary
entry as detail entry;

For ex:

Login_error=invalid username/password
Login_error_detail=Please specify your correct login and password

If the system can't find a detail entry, I noted that it will use the
primary entry as detail.

I hope this helps,

-----Original Message-----
From: Wolfgang Schreiner [] 
Sent: woensdag 13 juli 2005 10:52
To: MyFaces Discussion
Subject: incorrect display of error message


i would like to perform some validation checks on my web application. it 
works but always displays the error message twice

my jsp code:
            <h:commandButton value="#{msg.button_value}" 
            <h:outputText id="loginError" binding="#{login.component}" />
            <h:message for="loginError" style="color:red" 
showSummary="true" />

and the snippet from the login backing bean:
                new FacesMessage(bundle.getString("invalid_login"))

the output for the loginError component is always "invalid 
username/password invalid username/password"
anyone encountered similar problems?

best regards,


View raw message