1 Reply Latest reply on Sep 18, 2008 7:43 PM by norad2

    Difference between seam.properties and components.xml ??

    leeth

      I have a question regarding the difference between seam.properties and components.xml. I have a named SLSB where I have a property that needs to be configured . If I configure the property via seam.properties the property remains NULL. However if I use components.xml to configure the property the property is set correctly.
      As far as I understand configuration via seam.properties or components.xml should have the same behaviour, but this example tells me otherwise.




      @Name("myComponent")
      @Stateless
      public class ActionImpl implements Action{
      
      private string myProperty;
      
      ...
      }



      seam.properties


      myComponent.myProperty = foo




      components.xml


      <component name="myComponent" >
      <property name="myProperty"> foo </property>
      </component>



        • 1. Re: Difference between seam.properties and components.xml ??
          norad2

          seam.properties is just a properties file


          components.xml allows you to set properties and configure many other options as well




          As for why it doesn't work. I assume you have the getters/setters provided. Ff not this will need to be added. Additionally, I had to make a copy of seam.properties and place it in WEB-INF/classes/ folder of the war. I don't know if this is a requirement or not but that was the only way I was able to get it working. I just left the seam.properties in the jar empty.