title: calling a java servlet from javascript ajax post method
body: <p>this might seem like a naive question but I'm fairly new to Java servlets and tomcat. I'm trying to call a servlet method by .post method in my javascript file. javascript is used in a .jsp file. everything works fine as long as the servlet is in the same directory with the jsp but when I change the path for file I can't get it to work no matter what I do. I tried these:</p>
  
  <pre><code>    $.post("./classes/myServlets/WEB-INF/order", $.param(data), function(response) {
      document.getElementById("Table").innerHTML = "Considered table number  " + response + "  for you";
  });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>    $.post("/classes/myServlets/WEB-INF/order", $.param(data), function(response) {
      document.getElementById("Table").innerHTML = "Considered table number  " + response + "  for you";
  });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>    $.post("order", $.param(data), function(response) {
      document.getElementById("Table").innerHTML = "Considered table number  " + response + "  for you";
  });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>    $.post("/classes/myServlets/WEB-INF/order.java", $.param(data), function(response) {
      document.getElementById("Table").innerHTML = "Considered table number  " + response + "  for you";
  });
  </code></pre>
  
  <p>I know this must be very easy but I can't find the instructions anywhere. thank's in advance.</p>