The following is an addition program to add two numbers.
my Server-side coding and Client-side coding as follows.
it throws error like
ReferenceError: com is not defined at (compiled_code):24
To work with Java Adapter Http Adapter is mandatory.
Server.js and client.js as follows
package com.mss;
public class Calculator {
public int addTwoIntegers(String first, String second){
int c=Integer.parseInt(first)+Integer.parseInt(second);
return Integer.toString(c);
}
}
function addTwoIntegers(){
alert("hi");
var calcInstance = new com.mss.Calculator();
return {
result : calcInstance.addTwoIntegers("1","2")
};
}