I am trying to return a value from java function in GWT to javascript via JSNI
static public int call() { return 20; }
public static native int jstest() /*-{
try{
val=@com.xxxx.package::call()();
window.alert("Val:"+val);
return $wnd.val;
} catch(e) {
console.error(e.message);
}
}-*/;
and in javascript alert(document.val);
, I end up with Exception Something other than an int was returned from JSNI method. I guess I am messing up in returning value to javascript. Please let me know where I go wrong!