title: jsf 2 application scope bean initiliazed fron faces-config.xml
body: <p>I'd like to initiliaze the properties of a bean (application scope) from the faces-config.xml. I tried different configuration without success.  At library level I'm using jsf 2.2  - jboss-jsf-api_2.2_spec.jar. At project level faces-config is configured to 2.0 version. I don't know if that is the problem. JBDS 7 don't let me to change to 2.2 beacouse of conflict with others Project Facets.</p>
  
  <p>This is the faces-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
          http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"&gt;      
      &lt;managed-bean&gt;
          &lt;managed-bean-name&gt;appBean&lt;/managed-bean-name&gt;
          &lt;managed-bean-class&gt;package.ApplicationBean&lt;/managed-bean-class&gt;
          &lt;managed-bean-scope&gt;application&lt;/managed-bean-scope&gt;
          &lt;managed-property&gt;
              &lt;property-name&gt;cookieNameLocale&lt;/property-name&gt;
              &lt;property-class&gt;java.lang.String&lt;/property-class&gt;
              &lt;value&gt;someText&lt;/value&gt;
          &lt;/managed-property&gt;
          &lt;managed-property&gt;
              &lt;property-name&gt;debug&lt;/property-name&gt;
              &lt;property-class&gt;boolean&lt;/property-class&gt;
              &lt;value&gt;true&lt;/value&gt;
          &lt;/managed-property&gt;
      &lt;/managed-bean&gt;
      &lt;application&gt;
          &lt;locale-config&gt;
              &lt;default-locale&gt;xx_XX&lt;/default-locale&gt;
              &lt;supported-locale&gt;xx_XX&lt;/supported-locale&gt;
          &lt;/locale-config&gt;
          &lt;resource-bundle&gt;
              &lt;base-name&gt;locale&lt;/base-name&gt;
              &lt;var&gt;i18n&lt;/var&gt;
          &lt;/resource-bundle&gt;
       &lt;/application&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>This is the application scope bean:</p>
  
  <pre><code>public class ApplicationBean implements Serializable {
  
      private boolean debug;
      private String cookieNameLocale;
  
      //respectively getters and setters
  }
  </code></pre>
  
  <p>When @Inject the appBean into another session scope bean the properties are not initiliazed. There are not errors and appBean  is created before session bean (using @PostConstruct to print)</p>