1 Reply Latest reply on Mar 24, 2008 2:51 PM by Jacob Orshalick

    Configuring custom Seam components in components.xml?

    Ben Moore Newbie

      Hi,


      I am trying to configure my custom Seam component using components.xml, but it's not working. I have:


      <components ... ...
         xmlns:foo="http://foo.com/mycomponents">
         ...
         ...
         <foo:applicationSettings environment="production"/>
      </components>
      
      ApplicationSettings.java :
      
      @Scope(ScopeType.APPLICATION)
      @Name("applicationSettings")
      public class ApplicationSettings implements Serializable {
      
        private String environment;
      
        // getters and settings omitted
      
        public ApplicationSettings() {}
      }
      
      package-info.java:
      
      @Namespace(value="http://foo.com/mycomponents")
      package com.foo.mycomponents;
      
      import org.jboss.seam.annotations.Namespace;
      



      The constructor and setEnvironment() are never called, and when I reference #{applicationSettings} in Facelets, it resolves but the variable hasn't been previously instantiated. What am I doing wrong?


      Thanks for any advice, Ben