2 Replies Latest reply on May 19, 2007 7:26 AM by ewfolf

    property injection

      hi dudes,

      how can i inject properties into my seam application? is it possible to use the seam.properties file for that purpose?
      i'm new in jee webapp development. would be great to have some information.

      thanks a lot
      ew

        • 1. Re: property injection
          monkeyden

          I don't know if this is overkill, from a functional perspective, but have you tried something like this?

          <factory name="myProperty" value="myValue" auto-create="true"/>

          • 2. Re: property injection

            @monkeyden: thanks for your reply. i found the corresponding entry in the documentation.

            unfortunately, it doesn't work actually. i'm using the seam.properties settings configuration.

            seam.properties:

            applicationSettings.profilesPath /profiles
            


            ApplicationSettings.java:
            @Name("applicationSettings")
            @Install(precedence = BUILT_IN)
            @Intercept(NEVER)
            @Scope(ScopeType.APPLICATION)
            public class ApplicationSettings {
             private String profilesPath;
            
             public String getProfilesPath() {
             return profilesPath;
             }
            
             public void setProfilesPath(String profilesPath) {
             this.profilesPath = profilesPath;
             }
            
             public static ApplicationSettings instance() {
             return (ApplicationSettings) Component
             .getInstance(ApplicationSettings.class);
             }
            }


            within my actionbeans i tried to get the propery via
            ApplicationSettings.instance().getProfilesPath()



            any ideas?
            thanks
            ew