4 Replies Latest reply on May 19, 2009 4:48 PM by GT Nguyen

    Injecting application-scope variable

    GT Nguyen Newbie

      Hello there,

      I have a singleton that auto-starts and stores some database values in application-scope variables.

      When I try to access the variables on the HTML page, it works fine.

      When I try to inject the variables into a Seam Action bean, I get 'null' values.

      I'm new to Seam.  Any help would be appreciated.  Code snippet below.

      G.T. Nguyen

      public interface ApplicationParams
          public void onCreate(Component self);
          public String getTest();
      public class ApplicationParamsBean implements ApplicationParams
          private String test = "";
          public void onCreate(Component self) {
           // retrieve value from database
           test = "something";
          public String getTest() {
           return test;
      <ui:define name="body">
      // Test Bean
      public class TestBean implements Test
           @In("#{applicationParams.test}") private String test;
           // test returns null (???)