Passing a javascript variable in Ajax to a Java class
<p>I am passing a javscript variable to a java class. I am not sure if this is consider a proper way, if so is my syntax correct and how can i make sure that the variable has passed successfully to my java class?</p>

<pre><code>var key = record.getKey();
$.ajax({
    type: "POST",
    url: "apps/APP/src/Test.java",
    data: {id : key},
    success: function(msg){
        alert( "Data Saved: " + msg );
    }
});
</code></pre>