Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the result(response) from this jvm? #27

Open
mantinghui opened this issue Mar 7, 2017 · 3 comments
Open

How to get the result(response) from this jvm? #27

mantinghui opened this issue Mar 7, 2017 · 3 comments

Comments

@mantinghui
Copy link

I mean,i want to get the result from a java function,can this node-jvm do this?

@YaroslavGaponov
Copy link
Owner

I think you can to create java code which run some java function and result will pass to javascript code like this https://github.com/YaroslavGaponov/node-jvm/tree/master/examples/jsclass

@mantinghui
Copy link
Author

mantinghui commented Mar 8, 2017

It‘s great!Thank you.But……there is still a small problem that when i send an int as an input parameter in Java class,the function and other functions behind it didn't work.They had done nothing.My own code just like this:
(MyJsClass.js)
MyJsClass.prototype.setaaa = function(i) {
console.log("i:"+i);
abc.aaa = i;
}
MyJsClass.prototype.showaaa = function() {
console.log(abc.aaa);
}
(IMyJsClass.java)
void setaaa(int i);
void showaaa();
(Main.java)
obj.setaaa(333);
obj.showaaa();

But when i send a String parameter,it‘s working normally.

@18876293672
Copy link

can you provide documents for this results,i don't know how to operate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants