title: How to pass an argument from javascript to a Servlet through JSP
body: <p>I'd like to do something like that</p>
  
  <pre><code>function(){
      &lt;% ExampleClass sample = new ExampleClass(); %&gt;
      var ID = 4;
      var something = &lt;%= sample.getSomethingById(ID) %&gt;
  }
  </code></pre>
  
  <p>How can I pass this ID to the jsp expression?</p>
  
  <p>Thanks for any suggestion, and sorry id the question is not so well formulated.</p>