4 Replies Latest reply on Mar 14, 2008 1:34 PM by newlukai

    Security: How to override messages

      See old Seam forum post.


      I'm using Seam 2.0.1.GA and want to override the messages appearing when someone logs in. The documentation says that I only have to specify values for 'org.jboss.seam.loginSuccessful' and so on. But this doesn't work for me.


      Pete Muir asked me to output this property manually. The result is that I can see this property as it should be. So I have to say, the property is correct.


      My apologies, Pete, for not knowing how to address a property like 'org.jboss.seam.loginSuccessful' (you have to do it this way: #{messages['org.jboss.seam.loginSuccessful']}. And not like this: #{messages.org.jboss.seam.loginSuccessful}). I'm using the dot too often.


      OK. Now I know that the property can be addressed. But how does this help with my problem? My login message isn't shown instead of the one specified by Seam.


      Thanks in advance.

        • 1. Re: Security: How to override messages
          pmuir

          Well, it means the property file is correctly read by Seam.


          File an issue in JIRA with a reproducible example so we can take a look.

          • 2. Re: Security: How to override messages

            Pete Muir wrote on Feb 26, 2008 10:40 AM:
            File an issue in JIRA with a reproducible example so we can take a look.


            Done.

            • 3. Re: Security: How to override messages

              OK. It's solved now. Shane Bryzak helped a lot on this:



              Shane Bryzak
              You don't have an entry in components.xml for your resource bundle. After adding the following entry your custom login message works:

                 
              <core:resource-loader>
                      <core:bundle-names>
                          <value>com.test.resources.test_messages</value>
                      </core:bundle-names>
                  </core:resource-loader>




              This is documented in the internationalization chapter of the reference docs.


              Thanks.

              • 4. Re: Security: How to override messages

                After I got this working, I noticed that the security message is displayed twice in a


                <h:messages layout="table" showDetail="true" />



                I thought I could get rid of this specifying a detailed message adding this line:


                org.jboss.seam.loginSuccessful_detail=bla



                to my ressource bundle. But this doesn't work as expected. I have inspected the code in Identity.login(), FacesSecurityEvents.addLoginSuccessfulMessage() and FacesMessages and think that _detail is completely irrelevant. Is that right?