title: Accessing static variable using OGNL in Struts2
body: <p>Good day!</p>
  
  <p>I am reading Manning's struts2 book and one of the topic is accessing the static variable using OGNL using the syntax  <code>@[fullClassName]@[property or methodCall]</code></p>
  
  <p>so I tried it on my program and my code is as follows:</p>
  
  <p>BEAN:</p>
  
  <pre><code>public class ContactsBean {
  
      private static int count = 1;
      //getter and setter
  }
  </code></pre>
  
  <p>ACTION:</p>
  
  <pre><code>private ContactsBean contacts;
  //getters and setters
  </code></pre>
  
  <p>JSP:</p>
  
  <pre><code>   &lt;s:property value="@com.demo.bean.ContactsBean@count" /&gt;
  
  or
      &lt;s:property value="@vs@count" /&gt;  //valuestack method
  </code></pre>
  
  <p>but it doesn't work. Am i missing something?
  Thank you.</p>