title: Java Bean getter not returning values
body: <p>I am trying to design a simple java bean/xhtml setup for a homework assignment. The implementation seems simple enough, however I can not get GlassFish to pull the info from the java bean and display it in the HTML.</p>
  
  <p>I wrote my code, and then created a war file and loaded that into GlassFish autodeploy.</p>
  
  <p>Here is index.xhtml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"&gt;
     &lt;h:head&gt;
        &lt;title&gt;System information&lt;/title&gt;
     &lt;/h:head&gt;
     &lt;h:body&gt;
        &lt;h:form&gt;
          &lt;p&gt;           
              This system's java version is #{properties.getJavaVersion}
          &lt;/p&gt;
          &lt;p&gt;
          This sytem's OS Name is #{properties.getOsName}
          &lt;/p&gt;
          &lt;p&gt;
          This System's OS version is #{properties.getOsVersion}
          &lt;/p&gt;
       &lt;/h:form&gt;
    &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my properties.java file located in root/WEB-INF/classes/com/stansbury/</p>
  
  <pre><code>package com.stansbury;
  
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  
  @ViewScoped
  @ManagedBean
  
  public class Properties {
  
  public String javaVersion;
  public String osName;
  public String osVersion;
  
  public String getJavaVersion() {
      javaVersion = System.getProperty("java.version");
      return javaVersion;
  }
  
  public String getOsName() {
      osName = System.getProperty("os.name");
      return osName;
  }
  
  public String getOsVersion() {
      osVersion = System.getProperty("os.version");
      return osVersion;
  }
  
  }
  </code></pre>
  
  <p>Here is my web.xml file located in root/WEB-INF/</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
     http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     version="2.5"&gt;
   &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
   &lt;/servlet&gt;
   &lt;servlet-mapping&gt;
     &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
     &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;faces/index.xhtml&lt;/welcome-file&gt;
   &lt;/welcome-file-list&gt;
   &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
   &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Last but not least my faces-config.xml file located root/META-INF:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config
     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"
  version="2.0"&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>What I see on my screen is "The System's os name is" and then blank. It is the same for the other two values. I created a traditional application to ensure that System.getProperties was working on my computer. I also initialized the properties.VALUES with different strings, just to make sure. I have been banging my head on a wall for the past six hours on this one. Again, this all seems like it should make sense based off different tutorials, textbooks and youtube video's I have researched. Any insight would be great!</p>