1 Reply Latest reply on Nov 5, 2009 10:57 PM by Leo van den berg

    Can not inject resource bundle or messages into bean class

    Marlin Johnson Newbie

      Here's what I have done


      In components.xml


      <core:resource-loader>
            <core:bundle-names>
                <value>office_messages</value>
            </core:bundle-names>
      </core:resource-loader>
      



      In my code


      @Name("officeIdReader")
      public class OfficeIdReader implements Serializable
      {
          @In
          private Map<String, String> messages;
      
          @In
          private ResourceBundle resourceBundle;
      
          private Collection <SelectItem> officeIds;
      
          public OfficeIdReader()
          {
              officeIds = new ArrayList<SelectItem>();
              initOfficeIds();
          }
      
          private void initOfficeIds()
          {
              for ( String key: messages.keySet())
              {
                  if ( key.startsWith("officeId"))
                  {
                      officeIds.add( new SelectItem(messages.get(key)));
                  }
              }
          }
      
          public Collection<SelectItem> getOfficeIds() {
              return officeIds;
          }
      
          public void setOfficeIds(Collection<SelectItem> officeIds) {
              this.officeIds = officeIds;
          }
      
      }
      



      Both messages and resourceBundle are null.. any ideas?