In my current project, I aim to utilize an ajax call for the client to post to a Java program, interact with the database, and display the results on my web page. Although my intention is to have Java print a simple greeting, the output currently displays all the code instead.
Below is the ajax call being used:
getText = function(duty){
$.ajax({
type: "POST",
url: 'querymanager.java',
data: (duty),
success: function(data){
console.log(data);
}
});
}
Here's the Java program it references:
class MyTestClass{
public static void main(String args[]){
try{
System.out.println('And here is the text to return to my website');
}
}