function ShowMessage() {
var url = '/primes/PrimesServlet';
var result = CQ.HTTP.eval(url);
var i = Number(document.getElementById("input").value);
var str = document.getElementById("test");
// if(result.checkPrimes(i)) // Want to call here
str.innerHTML = i + " là số nguyên tố";
// else str.innerHTML = i + " là hợp số";
document.getElementById("output").style.display="block";
}
public class PrimesServlet extends HttpServlet {
public boolean checkPrimes(long n) {
boolean _return;
MillerRabin obj = new MillerRabin();
_return = obj.checkPrimes(n);
return _return;
}
}
我想checkPrimes(long n)
从我的函数中调用该方法ShowMessage()
,但我不能。