title: Convert var javascript to java variable
body: <p>i am using jsp format eclipse 3.2 tomcat server 5.5. I have a problem to convert var variable (javascript) to int variable(java). what is the correct way to do this? </p>
  
  <p>In html body, i use this method to throw:</p>
  
  <pre><code>    String qwerty = Integer.toString(f);
      String asdf = Integer.toString(d);
              System.out.println("CONVERTED VALUE : "+qwerty+" "+asdf);
      %&gt;
      &lt;input type="hidden" id="balance" name="balance" value="&lt;%=qwerty%&gt;" /&gt;
      &lt;input type="hidden" id="loop" name="loop" value="&lt;%=asdf%&gt;" /&gt;
      &lt;%
      System.out.println("VALUES : "+balance+" "+loop);
  </code></pre>
  
  <p>In html head(script):</p>
  
  <pre><code>            &lt;script&gt;
              function myfunction()
              {
              var looping = document.getElementById("loop").value;
          var balancing = document.getElementById("balance").value;
  
          &lt;%
              String loop="&lt;%=document.writeln(looping)%&gt;";
          String balance="&lt;%=document.writeln(balancing)%&gt;";
  
          int balance = Integer.parseInt(balancing);
          int loop = Integer.parseInt(looping);
  
              %&gt;
              ..........................cont
  </code></pre>
  
  <p>how to convert this var to string?</p>