What is the best way to call a JavaScript function in a different .js file from a Java file?
Say, I have a String like so in a Java file:
String test = "[name1, name2, name2]";
What I am trying to do is the following:
- Convert the Java String into a JavaScript array
- Pass the JavaScript array to a JavaScript function in a different .js file.
Thanks,
Sony
If you want to use JavaScript in a Java application, you can use Rhino.
If you want to call client side JavaScript form a serverside Java web application, you can use DWR‘s Reverse Ajax.
Good luck!