title: How to pass bean value to javascript in jsp?
body: <p>I am trying to pass an int from a bean to a jsp page (using something like <code>&lt;%= TestBean.getNumber()%&gt;</code>). </p>
  
  <p>But when I am trying to pass it to javascript in the page, it's giving me error that says: "<code>non-static method cannot be referenced in static context"</code>. I am trying to form a loop in the script, something like:</p>
  
  <pre><code>    for (int i = 0; i &lt; (&lt;%= TestBean.getNumber()%&gt;); i++) 
      {
      // 
      }
  </code></pre>
  
  <p>Anyone knows how to pass a bean value to javascript? Thanks.</p>