8 Replies Latest reply on Aug 14, 2007 9:16 AM by atao

    resource bundle

    urswag

      m using Seam 2.0 Beta.
      I have troubles with the resource bundle. The texts do not appear.
      For example

      <h:outputText value="#{messagesAfn['pwdchange.screen.title']}" />
      

      generates an empty test. The pwdchange.screen.title entry is in the properties file.

      In components.xml I have the entry
       <core:resource-bundle>
       <core:bundle-names>
       <value>messagesAfn</value>
       </core:bundle-names>
       </core:resource-bundle>
      


      The properties File messagesAfn.properties
      is in the directory WEB-INF/classes of the war file.

      What can I do else? Can I debug this in a way?
      Thanks

        • 1. Re: resource bundle
          atao

          Only use "messages" to get the message map, i.e.:

          <h:outputText value="#{messages['pwdchange.screen.title']}" />
          


          even if you use different bundle names

          • 2. Re: resource bundle
            urswag


            Thanks but it does not change the effect. Simply
            pwdchange.screen.title is written on the screen.

            • 3. Re: resource bundle
              nickarls

              Does f:loadBundle see it?
              Does it work if you just put it in messages.properties?

              • 4. Re: resource bundle
                urswag

                Seam 2.0 Beta
                If I try this it works. The entry in the properties file for pwdchange.screen.title is printed out correctly.

                <f:loadBundle basename="messagesAfn" var="messagesAfn" />
                <h:outputText value="#{messagesAfn['pwdchange.screen.title']}" />
                


                Putting the entries in the properties file named messages.properties has the same effect. It works also only if I use loadBundle.



                • 5. Re: resource bundle
                  urswag

                  If I use it in the context with pages.xml it works.

                   <page view-id="/*" bundle="messagesAfn">
                  
                   </page>
                  


                  This works but I would to use it as a global resource.

                  • 6. Re: resource bundle
                    atao

                    What is you configuration in faces-config.xml?

                    What is the current value of locale?

                    • 7. Re: resource bundle
                      urswag

                       

                       <application>
                       <message-bundle>messages</message-bundle>
                       <locale-config>
                       <default-locale>en</default-locale>
                       </locale-config>
                       <!-- Disabled when using Ajax4JSF -->
                       <!--
                       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                       -->
                       </application>
                      


                      • 8. Re: resource bundle
                        atao

                        Try:

                        - either to remove default-locale in locale-config

                        - or to change the name of properties file from messagesAfn.properties to messagesAfn_en.properties