myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Kumari" <Rashmi.Kum...@rmsi.com>
Subject Re: incorrect display of error message
Date Wed, 13 Jul 2005 09:36:47 GMT

I had the same problem of getting the error messages twice.

I used this constructor of FacesMessage
FacesMessage(java.lang.String summary,  java.lang.String detail)
and set the detail to an empty string. Now it is working as desired.

So in ur case, you can try

context.addMessage(
                this.component.getClientId(context),
                new FacesMessage(bundle.getString("invalid_login"), "")
            );



Regards,

Rashmi





                                                                                         
                                          
                    Wolfgang                                                             
                                          
                    Schreiner               To:     MyFaces Discussion <users@myfaces.apache.org>
                                  
                    <wolfgang.schrein       cc:                                       
                                             
                    er@ec3.at>              Subject:     incorrect display of error message
                                        
                                                                                         
                                          
                    07/13/2005 02:22                                                     
                                          
                    PM                                                                   
                                          
                    Please respond to                                                    
                                          
                    "MyFaces                                                             
                                          
                    Discussion"                                                          
                                          
                                                                                         
                                          
                                                                                         
                                          




hi,

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}"
action="#{login.login}"/>
            <h:outputText id="loginError" binding="#{login.component}" />
            <h:message for="loginError" style="color:red"
showSummary="true" />

and the snippet from the login backing bean:
            context.addMessage(
                this.component.getClientId(context),
                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,

Wolfgang







Mime
View raw message